home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / penwin.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  104.1 KB  |  2,375 lines

  1. /****************************************************************************\
  2. *                                                                            *
  3. * PENWIN.H -  Pen Windows functions, types, and definitions                  *
  4. *                                                                            *
  5. *             Version 2.0                                                    *
  6. *                                                                            *
  7. *             Copyright (c) 1992-1995 Microsoft Corp. All rights reserved.   *
  8. *                                                                            *
  9. *******************************************************************************
  10. *
  11. * The following symbols control inclusion of various parts of this file;
  12. * (indented identifiers are included by the previous main identifier):
  13. *
  14. * #define:         To prevent inclusion of:
  15. *
  16. * PENVER           Pen Windows version number (0x0200).  To exclude
  17. *                   definitions introduced in version 2.0 (or above)
  18. *                   #define PENVER 0x0100 before #including <penwin.h>
  19. *
  20. * NOPENALC         Alphabet Code definitions and macros
  21. * NOPENAPPS        Pen Applications: Screen Keyboard
  22. * NOPENCTL         H/BEDIT, IEDIT, and pen-enabled USER controls, including:
  23. *   NOPENBEDIT      : Boxed Edit Control
  24. *   NOPENIEDIT      : Ink Edit Control
  25. *   NOPENHEDIT      : (H)Edit control
  26. * NOPENDATA        PenData APIs and definitions
  27. * NOPENDICT        Dictionary support
  28. * NOPENDRIVER      Pen Driver definitions, incl OEM
  29. * NOPENHRC         Handwriting Recognizer APIs and definitions
  30. * NOPENINKPUT      Inking and Input APIs and definitions
  31. * NOPENMISC        Miscellaneous Info and Utility APIs and definitions
  32. * NOPENMSGS        Pen Messages and definitions
  33. * NOPENNLS         National Language Support
  34. * NOPENRC1         Recognition Context APIs and definitions (1.0)
  35. * NOPENRES         Pen resources, including:
  36. *   NOPENBMP        : Pen-related bitmaps
  37. *   NOPENCURS       : Pen-related cursors
  38. * NOPENTARGET      Targeting APIs and definitions
  39. * NOPENVIRTEVENT   Virtual Event layer APIs
  40. *
  41. * _WIN32           non-Win32 components, subincludes:
  42. *                   : NOPENAPPS, NOPENDICT, NOPENRC1, NOPENVIRTEVENT
  43. *
  44. * "FBC" in the comments means that the feature exists only for
  45. * backward compatibility. It should not be used by new applications.
  46. \****************************************************************************/
  47.  
  48. #ifndef _INC_PENWIN
  49. #define _INC_PENWIN
  50. #pragma option push -b
  51.  
  52.  
  53.  
  54. #include <windows.h>
  55.  
  56.  
  57. #ifdef __BORLANDC__
  58. #  include <pshpack8.h>
  59. #endif
  60.  
  61. #ifndef _WIN32
  62. #ifndef RC_INVOKED
  63. #pragma pack(1)
  64. #endif /* RC_INVOKED */
  65. #endif //!_WIN32
  66.  
  67. #ifdef __cplusplus
  68. extern "C" {
  69. #endif /* __cplusplus */
  70.  
  71. #ifndef PENVER      /* may be pre-defined; otherwise assume version 2.0 */
  72.     #define PENVER  0x0200
  73. #endif //!PENVER
  74.  
  75. #ifdef _WIN32
  76.     #define NOPENAPPS
  77.     #define NOPENDICT
  78.     #define NOPENRC1
  79.     #define NOPENVIRTEVENT
  80.     #define NOPENAPIFUN
  81. #endif //_WIN32
  82.  
  83. #ifndef NOPENAPPS   // not available in WIN32
  84. #ifndef RC_INVOKED
  85.  
  86.     #include <skbapi.h>
  87.  
  88. #endif /* !RC_INVOKED */
  89. #endif /*!NOPENAPPS */
  90.  
  91. // other subsets:
  92.  
  93. #ifdef NOPENCTL
  94.     #define NOPENBEDIT
  95.     #define NOPENIEDIT
  96. #endif /* NOPENCTL */
  97.  
  98. #ifdef NOPENRES
  99.     #define NOPENBMP
  100.     #define NOPENCURS
  101. #endif /* NOPENRES */
  102.  
  103. //////////////////////////////////////////////////////////////////////////////
  104. /****** Definitions 1: for everything including RC compiler *****************/
  105.  
  106. //---------------------------------------------------------------------------
  107. #ifndef NOPENALC
  108.  
  109. // Enabled Alphabet:
  110. #define ALC_DEFAULT          0x00000000L // nothing
  111. #define ALC_LCALPHA          0x00000001L // a..z
  112. #define ALC_UCALPHA          0x00000002L // A..Z
  113. #define ALC_NUMERIC          0x00000004L // 0..9
  114. #define ALC_PUNC             0x00000008L // !-;`"?()&.,; and backslash
  115. #define ALC_MATH             0x00000010L // %^*()-+={}<>,/.
  116. #define ALC_MONETARY         0x00000020L // ,.$ or local
  117. #define ALC_OTHER            0x00000040L // @#|_~[]
  118. #define ALC_ASCII            0x00000080L // restrict to 7-bit chars 20..7f
  119. #define ALC_WHITE            0x00000100L // white space
  120. #define ALC_NONPRINT         0x00000200L // sp tab ret ctrl glyphs
  121. #define ALC_DBCS             0x00000400L // allow DBCS variety of SBCS
  122. #define ALC_JIS1             0x00000800L // kanji JPN, ShiftJIS 1 only
  123. #define ALC_GESTURE          0x00004000L // gestures
  124. #define ALC_USEBITMAP        0x00008000L // use rc.rgbfAlc to enable chars
  125. #define ALC_HIRAGANA         0x00010000L // hiragana JPN
  126. #define ALC_KATAKANA         0x00020000L // katakana JPN
  127. #define ALC_KANJI            0x00040000L // kanji JPN, ShiftJIS 1+2+3
  128. #define ALC_GLOBALPRIORITY   0x10000000L
  129. #define ALC_OEM              0x0FF80000L // OEM recognizer-specific
  130. #define ALC_RESERVED         0xE0003000L // avail for future use
  131. #define ALC_NOPRIORITY       0x00000000L // for alcPriority == none
  132.  
  133. #define ALC_ALPHA\
  134.     (ALC_LCALPHA | ALC_UCALPHA)                                // 0x00000003L
  135.  
  136. #define ALC_ALPHANUMERIC\
  137.     (ALC_ALPHA | ALC_NUMERIC)                                  // 0x00000007L
  138.  
  139. #define ALC_SYSMINIMUM\
  140.     (ALC_ALPHANUMERIC | ALC_PUNC | ALC_WHITE | ALC_GESTURE)    // 0x0000410FL
  141.  
  142. #define ALC_ALL\
  143.     (ALC_SYSMINIMUM | ALC_MATH | ALC_MONETARY\
  144.     | ALC_OTHER | ALC_NONPRINT)                                // 0x0000437FL
  145.  
  146. #define ALC_KANJISYSMINIMUM\
  147.     (ALC_SYSMINIMUM | ALC_HIRAGANA | ALC_KATAKANA | ALC_JIS1)  // 0x0003490FL
  148.  
  149. #define ALC_KANJIALL\
  150.     (ALC_ALL | ALC_HIRAGANA | ALC_KATAKANA | ALC_KANJI)        // 0x0007437FL
  151.  
  152. #endif /*!NOPENALC */
  153.  
  154. //---------------------------------------------------------------------------
  155. #ifndef NOPENBEDIT
  156. // box edit styles:
  157. #define BXS_NONE             0x0000U // none
  158. #define BXS_RECT             0x0001U // use rectangle instead of cusp
  159. #define BXS_BOXCROSS         0x0004U // use cross at box center
  160. #define BXS_MASK             0x0007U // mask for above
  161.  
  162. #endif /*!NOPENBEDIT */
  163.  
  164. //---------------------------------------------------------------------------
  165. #ifndef NOPENBMP
  166.  
  167. // Public Bitmaps :
  168. #define OBM_SKBBTNUP            32767
  169. #define OBM_SKBBTNDOWN          32766
  170. #define OBM_SKBBTNDISABLED      32765
  171.  
  172. #define OBM_ZENBTNUP            32764
  173. #define OBM_ZENBTNDOWN          32763
  174. #define OBM_ZENBTNDISABLED      32762
  175.  
  176. #define OBM_HANBTNUP            32761
  177. #define OBM_HANBTNDOWN          32760
  178. #define OBM_HANBTNDISABLED      32759
  179.  
  180. #define OBM_KKCBTNUP            32758
  181. #define OBM_KKCBTNDOWN          32757
  182. #define OBM_KKCBTNDISABLED      32756
  183.  
  184. #define OBM_SIPBTNUP            32755
  185. #define OBM_SIPBTNDOWN          32754
  186. #define OBM_SIPBTNDISABLED      32753
  187.  
  188. #define OBM_PTYBTNUP            32752
  189. #define OBM_PTYBTNDOWN          32751
  190. #define OBM_PTYBTNDISABLED      32750
  191. #endif /*!NOPENBMP */
  192.  
  193. //---------------------------------------------------------------------------
  194. #ifndef NOPENCURS
  195. // Default pen cursor to indicate writing, points northwest
  196. #define IDC_PEN         MAKEINTRESOURCE(32631)
  197.  
  198. // alternate select cursor: upsidedown standard arrow, points southeast
  199. #define IDC_ALTSELECT   MAKEINTRESOURCE(32501)
  200.  
  201. #endif /*!NOPENCURS */
  202.  
  203. //---------------------------------------------------------------------------
  204. #ifndef NOPENHRC
  205. // special SYV values:
  206. #define SYV_NULL                0x00000000L
  207. #define SYV_UNKNOWN             0x00000001L
  208. #define SYV_EMPTY               0x00000003L
  209. #define SYV_BEGINOR             0x00000010L
  210. #define SYV_ENDOR               0x00000011L
  211. #define SYV_OR                  0x00000012L
  212. #define SYV_SOFTNEWLINE         0x00000020L
  213. #define SYV_SPACENULL           0x00010000L   // SyvCharacterToSymbol('\0')
  214.  
  215. // SYV values for gestures:
  216. #define SYV_SELECTFIRST         0x0002FFC0L   // . means circle in following
  217. #define SYV_LASSO               0x0002FFC1L   // lasso o-tap
  218. #define SYV_SELECTLEFT          0x0002FFC2L   // no glyph
  219. #define SYV_SELECTRIGHT         0x0002FFC3L   // no glyph
  220. #define SYV_SELECTLAST          0x0002FFCFL   // 16 SYVs reserved for selection
  221.  
  222. #define SYV_CLEARCHAR           0x0002FFD2L   // d.
  223. #define SYV_HELP                0x0002FFD3L   // no glyph
  224. #define SYV_KKCONVERT           0x0002FFD4L   // k.
  225. #define SYV_CLEAR               0x0002FFD5L   // d.
  226. #define SYV_INSERT              0x0002FFD6L   // ^.
  227. #define SYV_CONTEXT             0x0002FFD7L   // m.
  228. #define SYV_EXTENDSELECT        0x0002FFD8L   // no glyph
  229. #define SYV_UNDO                0x0002FFD9L   // u.
  230. #define SYV_COPY                0x0002FFDAL   // c.
  231. #define SYV_CUT                 0x0002FFDBL   // x.
  232. #define SYV_PASTE               0x0002FFDCL   // p.
  233. #define SYV_CLEARWORD           0x0002FFDDL   // no glyph
  234. #define SYV_USER                0x0002FFDEL   // reserved
  235. #define SYV_CORRECT             0x0002FFDFL   // check.
  236.  
  237. #define SYV_BACKSPACE           0x00020008L   // no glyph
  238. #define SYV_TAB                 0x00020009L   // t.
  239. #define SYV_RETURN              0x0002000DL   // n.
  240. #define SYV_SPACE               0x00020020L   // s.
  241.  
  242. // Application specific gestures, Circle a-z and Circle A-Z:
  243. #define SYV_APPGESTUREMASK      0x00020000L
  244. #define SYV_CIRCLEUPA           0x000224B6L   // map into Unicode space
  245. #define SYV_CIRCLEUPZ           0x000224CFL   //  for circled letters
  246. #define SYV_CIRCLELOA           0x000224D0L
  247. #define SYV_CIRCLELOZ           0x000224E9L
  248.  
  249. // SYV definitions for shapes:
  250. #define SYV_SHAPELINE           0x00040001L
  251. #define SYV_SHAPEELLIPSE        0x00040002L
  252. #define SYV_SHAPERECT           0x00040003L
  253. #define SYV_SHAPEMIN            SYV_SHAPELINE // alias
  254. #define SYV_SHAPEMAX            SYV_SHAPERECT // alias
  255.  
  256. // SYV classes:
  257. #define SYVHI_SPECIAL           0
  258. #define SYVHI_ANSI              1
  259. #define SYVHI_GESTURE           2
  260. #define SYVHI_KANJI             3
  261. #define SYVHI_SHAPE             4
  262. #define SYVHI_UNICODE           5
  263. #define SYVHI_VKEY              6
  264. #endif //!NOPENHRC
  265.  
  266. //---------------------------------------------------------------------------
  267. #ifndef NOPENIEDIT
  268.  
  269. // IEdit Pop-up Menu Command Items
  270. #define IEM_UNDO                1          // Undo
  271. #define IEM_CUT                 2          // Cut
  272. #define IEM_COPY                3          // Copy
  273. #define IEM_PASTE               4          // Paste
  274. #define IEM_CLEAR               5          // Clear
  275. #define IEM_SELECTALL           6          // Select All Strokes
  276. #define IEM_ERASE               7          // Use Eraser
  277. #define IEM_PROPERTIES          8          // DoProperties
  278. #define IEM_LASSO               9          // Use Lasso
  279. #define IEM_RESIZE              10         // Resize
  280.  
  281. #define IEM_USER                    100    // first menu item# available to app
  282.  
  283. // IEdit Style Attributes
  284. #define IES_BORDER              0x0001   // ctl has a border
  285. #define IES_HSCROLL             0x0002   // ctl is horizontally scrollable
  286. #define IES_VSCROLL             0x0004   // ctl is vertically scrollable
  287. #define IES_OWNERDRAW           0x0008   // ctl will be drawn by parent window
  288.  
  289. #endif /*!NOPENIEDIT */
  290.  
  291. #ifndef RC_INVOKED  // ... rest of file of no interest to rc compiler
  292. //////////////////////////////////////////////////////////////////////////////
  293.  
  294. /****** Definitions 2: RC compiler excluded ********************************/
  295.  
  296. //---------------------------------------------------------------------------
  297. #ifndef NOPENDATA
  298.  
  299. // PenData API constants:
  300.  
  301. // ANIMATEINFO callback options:
  302. #define AI_CBSTROKE             0xFFFF  // Animate callback after every stroke
  303.  
  304. // ANIMATEINFO options:
  305. #define AI_SKIPUPSTROKES        0x0001  // ignore upstrokes in animation
  306.  
  307. // CompressPenData() API options:
  308. #define CMPD_COMPRESS           0x0001
  309. #define CMPD_DECOMPRESS         0x0002
  310.  
  311. // CreatePenDataRegion types:
  312. #define CPDR_BOX                1       // bounding box
  313. #define CPDR_LASSO              2       // lasso
  314.  
  315. // CreatePenData (CPD) and Pen Hardware (PHW) Flags;
  316. // The order of PHW flags is important:
  317. #define CPD_DEFAULT             0x047F  // CPD_TIME | PHW_ALL
  318. #define CPD_USERBYTE            0x0100  // alloc 8 bits/stroke
  319. #define CPD_USERWORD            0x0200  // alloc 16 bits/stroke
  320. #define CPD_USERDWORD           0x0300  // alloc 32 bits/stroke
  321. #define CPD_TIME                0x0400  // maintain abs time info per stroke
  322.  
  323. // DrawPenDataEx() flags/options:
  324. #define DPD_HDCPEN              0x0001  // use pen selected in HDC
  325. #define DPD_DRAWSEL             0x0002  // draw the selection
  326.  
  327. // ExtractPenDataPoints options (EPDP_xx):
  328. #define EPDP_REMOVE             0x0001  // Remove points from the pendata
  329.  
  330. // ExtractPenDataStrokes options and modifiers (EPDS_xx):
  331. #define EPDS_SELECT             1       // selected strokes
  332. #define EPDS_STROKEINDEX        2       // index
  333. #define EPDS_USER               3       // user-specific value
  334. #define EPDS_PENTIP             4       // complete pentip
  335. #define EPDS_TIPCOLOR           5       // pentip color
  336. #define EPDS_TIPWIDTH           6       // pentip width
  337. #define EPDS_TIPNIB             7       // pentip nib style
  338. #define EPDS_INKSET             8       // inkset match
  339.  
  340. #define EPDS_EQ                 0x0000  // default: same as
  341. #define EPDS_LT                 0x0010  // all strokes less than
  342. #define EPDS_GT                 0x0020  // all strokes greater than
  343. #define EPDS_NOT                0x0040  // all strokes not matching
  344. #define EPDS_NE                 0x0040  // alias
  345. #define EPDS_GTE                0x0050  // alias for NOT LT
  346. #define EPDS_LTE                0x0060  // alias for NOT GT
  347.  
  348. #define EPDS_REMOVE             0x8000  // remove matching strokes from source
  349.  
  350. // GetPenDataAttributes options (GPA_xx):
  351. #define GPA_MAXLEN              1   // length of longest stroke
  352. #define GPA_POINTS              2   // total number of points
  353. #define GPA_PDTS                3   // PDTS_xx bits
  354. #define GPA_RATE                4   // get sampling rate
  355. #define GPA_RECTBOUND           5   // bounding rect of all points
  356. #define GPA_RECTBOUNDINK        6   // ditto, adj for fat ink
  357. #define GPA_SIZE                7   // size of pendata in bytes
  358. #define GPA_STROKES             8   // total number of strokes
  359. #define GPA_TIME                9   // absolute time at creation of pendata
  360. #define GPA_USER                10  // number of user bytes available: 0, 1, 2, 4
  361. #define GPA_VERSION             11  // version number of pendata
  362.  
  363. // GetStrokeAttributes options (GSA_xx):
  364. #define GSA_PENTIP              1   // get stroke pentip (color, width, nib)
  365. #define GSA_PENTIPCLASS         2   // same as GSA_PENTIP
  366. #define GSA_USER                3   // get stroke user value
  367. #define GSA_USERCLASS           4   // get stroke's class user value
  368. #define GSA_TIME                5   // get time of stroke
  369. #define GSA_SIZE                6   // get size of stroke in points and bytes
  370. #define GSA_SELECT              7   // get selection status of stroke
  371. #define GSA_DOWN                8   // get up/down state of stroke
  372. #define GSA_RECTBOUND           9   // get the bounding rectangle of the stroke
  373.  
  374. // GetStrokeTableAttributes options (GSA_xx):
  375. #define GSA_PENTIPTABLE         10  // get table-indexed pentip
  376. #define GSA_SIZETABLE           11  // get count of Stroke Class Table entries
  377. #define GSA_USERTABLE           12  // get table-indexed user value
  378.  
  379. #ifndef IX_END
  380. #define IX_END                  0xFFFF  // to or past last available index
  381. #endif //!IX_END
  382.  
  383. // PenTip:
  384. #define PENTIP_NIBDEFAULT       ((BYTE)0)       // default pen tip nib style
  385. #define PENTIP_HEIGHTDEFAULT    ((BYTE)0)       // default pen tip nib height
  386. #define PENTIP_OPAQUE           ((BYTE)0xFF)    // default opaque ink
  387. #define PENTIP_HILITE           ((BYTE)0x80)
  388. #define PENTIP_TRANSPARENT      ((BYTE)0)
  389.  
  390. // General PenData API return values (PDR_xx):
  391. #define PDR_NOHIT               3       // hit test failed
  392. #define PDR_HIT                 2       // hit test succeeded
  393. #define PDR_OK                  1       // success
  394. #define PDR_CANCEL              0       // callback cancel or impasse
  395.  
  396. #define PDR_ERROR               (-1)    // parameter or unspecified error
  397. #define PDR_PNDTERR             (-2)    // bad pendata
  398. #define PDR_VERSIONERR          (-3)    // pendata version error
  399. #define PDR_COMPRESSED          (-4)    // pendata is compressed
  400. #define PDR_STRKINDEXERR        (-5)    // stroke index error
  401. #define PDR_PNTINDEXERR         (-6)    // point index error
  402. #define PDR_MEMERR              (-7)    // memory error
  403. #define PDR_INKSETERR           (-8)    // bad inkset
  404. #define PDR_ABORT               (-9)    // pendata has become invalid, e.g.
  405. #define PDR_NA                  (-10)   // option not available (pw kernel)
  406.  
  407. #define PDR_USERDATAERR         (-16)   // user data error
  408. #define PDR_SCALINGERR          (-17)   // scale error
  409. #define PDR_TIMESTAMPERR        (-18)   // timestamp error
  410. #define PDR_OEMDATAERR          (-19)   // OEM data error
  411. #define PDR_SCTERR              (-20)   // SCT error (full)
  412.  
  413. // PenData Scaling (PDTS):
  414. #define PDTS_LOMETRIC           0       // 0.01mm
  415. #define PDTS_HIMETRIC           1       // 0.001mm
  416. #define PDTS_HIENGLISH          2       // 0.001"
  417. #define PDTS_STANDARDSCALE      2       // PDTS_HIENGLISH   alias
  418. #define PDTS_DISPLAY            3       // display pixel
  419. #define PDTS_ARBITRARY          4       // app-specific scaling
  420. #define PDTS_SCALEMASK          0x000F  // scaling values in low nibble
  421.  
  422. // CompactPenData() API trim options:
  423. #define PDTT_DEFAULT            0x0000
  424. #define PDTT_PENINFO            0x0100
  425. #define PDTT_UPPOINTS           0x0200
  426. #define PDTT_OEMDATA            0x0400
  427. #define PDTT_COLLINEAR          0x0800
  428. #define PDTT_COLINEAR           0x0800  // alt sp alias
  429. #define PDTT_DECOMPRESS         0x4000  // decompress the data
  430. #define PDTT_COMPRESS           0x8000
  431. #define PDTT_ALL                0x0F00  // PENINFO|UPPOINTS|OEMDATA|COLLINEAR
  432.  
  433. #define PHW_NONE                0x0000  // no OEMdata
  434. #define PHW_PRESSURE            0x0001  // report pressure in OEMdata if avail
  435. #define PHW_HEIGHT              0x0002  // ditto height
  436. #define PHW_ANGLEXY             0x0004  // ditto xy angle
  437. #define PHW_ANGLEZ              0x0008  // ditto z angle
  438. #define PHW_BARRELROTATION      0x0010  // ditto barrel rotation
  439. #define PHW_OEMSPECIFIC         0x0020  // ditto OEM-specific value
  440. #define PHW_PDK                 0x0040  // report per-point PDK_xx in OEM data
  441. #define PHW_ALL                 0x007F  // report everything
  442.  
  443. // compact pen data trim options: matches PDTT_values (see above)
  444. #define PDTS_COMPRESS2NDDERIV   0x0010  // compress using 2nd deriv
  445. #define PDTS_COMPRESSMETHOD     0x00F0  // sum of compress method flags
  446. #define PDTS_NOPENINFO          0x0100  // removes PENINFO struct from header
  447. #define PDTS_NOUPPOINTS         0x0200  // remove up pts
  448. #define PDTS_NOOEMDATA          0x0400  // remove OEM data
  449. #define PDTS_NOCOLLINEAR        0x0800  // remove successive identical pts
  450. #define PDTS_NOCOLINEAR         0x0800  // alt sp alias
  451. #define PDTS_NOTICK             0x1000  // remove timing info (2.0)
  452. #define PDTS_NOUSER             0x2000  // remove user info (2.0)
  453. #define PDTS_NOEMPTYSTROKES     0x4000  // remove empty strokes (2.0)
  454. #define PDTS_COMPRESSED         0x8000  // perform lossless compression
  455.  
  456. // SetStrokeAttributes options (SSA_xx):
  457. #define SSA_PENTIP              1       // set stroke tip (color, width, nib)
  458. #define SSA_PENTIPCLASS         2       // set stroke's class pentip
  459. #define SSA_USER                3       // set stroke user value
  460. #define SSA_USERCLASS           4       // set stroke's class user value
  461. #define SSA_TIME                5       // set time of stroke
  462. #define SSA_SELECT              6       // set selection status of stroke
  463. #define SSA_DOWN                7       // set up/down state of stroke
  464.  
  465. // SetStrokeTableAttributes options (SSA_xx):
  466. #define SSA_PENTIPTABLE         8       // set table-indexed pentip
  467. #define SSA_USERTABLE           9       // set table-indexed user value
  468.  
  469. // PenTip flag bits:
  470. #define TIP_ERASECOLOR          1       // erase specific color pentip.rgb
  471.  
  472. // TrimPenData() API options:
  473. #define TPD_RECALCSIZE          0x0000  // no trim, used for resize calc
  474. #define TPD_USER                0x0080  // per-stroke user info
  475. #define TPD_TIME                0x0100  // per-stroke timing info
  476. #define TPD_UPPOINTS            0x0200  // x-y data up points
  477. #define TPD_COLLINEAR           0x0400  // colinear and coincident points
  478. #define TPD_COLINEAR            0x0400  // alt sp alias
  479. #define TPD_PENINFO             0x0800  // PenInfo struct and all OEM
  480. #define TPD_PHW                 0x1000  // OEM & pdk except stroke tick or user
  481. #define TPD_OEMDATA             0x1000  // ditto
  482. #define TPD_EMPTYSTROKES        0x2000  // strokes with zero points
  483. #define TPD_EVERYTHING          0x3FFF  // everything (incl PHW_xx) except down pts
  484.  
  485. #endif /*!NOPENDATA */
  486.  
  487. //---------------------------------------------------------------------------
  488. #ifndef NOPENDICT   // not available in WIN32
  489.  
  490. // Dictionary:
  491. #define cbDictPathMax           255
  492. #define DIRQ_QUERY              1
  493. #define DIRQ_DESCRIPTION        2
  494. #define DIRQ_CONFIGURE          3
  495. #define DIRQ_OPEN               4
  496. #define DIRQ_CLOSE              5
  497. #define DIRQ_SETWORDLISTS       6
  498. #define DIRQ_STRING             7
  499. #define DIRQ_SUGGEST            8
  500. #define DIRQ_ADD                9
  501. #define DIRQ_DELETE             10
  502. #define DIRQ_FLUSH              11
  503. #define DIRQ_RCCHANGE           12
  504. #define DIRQ_SYMBOLGRAPH        13
  505. #define DIRQ_INIT               14
  506. #define DIRQ_CLEANUP            15
  507. #define DIRQ_COPYRIGHT          16
  508. #define DIRQ_USER               4096
  509. #endif /*!NOPENDICT */
  510.  
  511. //---------------------------------------------------------------------------
  512. #ifndef NOPENDRIVER
  513.  
  514. // Pen driver:
  515. #define BITPENUP                0x8000
  516.  
  517. // Pen Driver messages:
  518. #define DRV_SetPenDriverEntryPoints     DRV_RESERVED+1
  519. #define DRV_SetEntryPoints              DRV_RESERVED+1  // alias
  520. #define DRV_RemovePenDriverEntryPoints  DRV_RESERVED+2
  521. #define DRV_RemoveEntryPoints           DRV_RESERVED+2  // alias
  522. #define DRV_SetPenSamplingRate          DRV_RESERVED+3
  523. #define DRV_SetPenSamplingDist          DRV_RESERVED+4
  524. #define DRV_GetName                     DRV_RESERVED+5
  525. #define DRV_GetVersion                  DRV_RESERVED+6
  526. #define DRV_GetPenInfo                  DRV_RESERVED+7
  527. #define DRV_PenPlayStart                DRV_RESERVED+8
  528. #define DRV_PenPlayBack                 DRV_RESERVED+9
  529. #define DRV_PenPlayStop                 DRV_RESERVED+10
  530. #define DRV_GetCalibration              DRV_RESERVED+11
  531. #define DRV_SetCalibration              DRV_RESERVED+12
  532. #define DRV_Reserved1                   DRV_RESERVED+13
  533. #define DRV_Reserved2                   DRV_RESERVED+14
  534. #define DRV_Query                       DRV_RESERVED+15
  535. #define DRV_GetPenSamplingRate          DRV_RESERVED+16
  536. #define DRV_Calibrate                   DRV_RESERVED+17
  537.  
  538. // Pen Driver Playback constants:
  539. #define PLAY_VERSION_10_DATA 0
  540. #define PLAY_VERSION_20_DATA 1
  541.  
  542. // Pen Driver return values:
  543. #define DRV_FAILURE             0x00000000
  544. #define DRV_SUCCESS             0x00000001
  545. #define DRV_BADPARAM1           0xFFFFFFFF
  546. #define DRV_BADPARAM2           0xFFFFFFFE
  547. #define DRV_BADSTRUCT           0xFFFFFFFD
  548.  
  549. // Pen Driver register messages flags:
  550. #define PENREG_DEFAULT          0x00000002
  551. #define PENREG_WILLHANDLEMOUSE  0x00000001
  552.  
  553. #define MAXOEMDATAWORDS         6             // rgwOemData[MAXOEMDATAWORDS]
  554.  
  555. // Pen Collection Mode termination conditions:
  556. // (note update doc for PCMINFO struct if change these)
  557. #define PCM_PENUP               0x00000001L   // stop on penup
  558. #define PCM_RANGE               0x00000002L   // stop on leaving range
  559. #define PCM_INVERT              0x00000020L   // stop on tap of opposite end
  560. #define PCM_RECTEXCLUDE         0x00002000L   // click in exclude rect
  561. #define PCM_RECTBOUND           0x00004000L   // click outside bounds rect
  562. #define PCM_TIMEOUT             0x00008000L   // no activity for timeout ms
  563. // new for 2.0:
  564. #define PCM_RGNBOUND            0x00010000L   // click outside bounding region
  565. #define PCM_RGNEXCLUDE          0x00020000L   // click in exclude region
  566. #define PCM_DOPOLLING           0x00040000L   // polling mode
  567. #define PCM_TAPNHOLD            0x00080000L   // check for Tap And Hold
  568. #define PCM_ADDDEFAULTS         RC_LDEFAULTFLAGS /* 0x80000000L */
  569.  
  570. // Pen Device Capabilities:
  571. #define PDC_INTEGRATED          0x00000001L   // display==digitizer
  572. #define PDC_PROXIMITY           0x00000002L   // detect non-contacting pen
  573. #define PDC_RANGE               0x00000004L   // event on out-of-range
  574. #define PDC_INVERT              0x00000008L   // pen opposite end detect
  575. #define PDC_RELATIVE            0x00000010L   // pen driver coords
  576. #define PDC_BARREL1             0x00000020L   // barrel button 1 present
  577. #define PDC_BARREL2             0x00000040L   // ditto 2
  578. #define PDC_BARREL3             0x00000080L   // ditto 3
  579.  
  580. // Pen Driver Kit states:
  581. #define PDK_NULL                0x0000  // default to no flags set
  582. #define PDK_UP                  0x0000  // PDK_NULL alias
  583. #define PDK_DOWN                0x0001  // pentip switch ON due to contact
  584. #define PDK_BARREL1             0x0002  // barrel1 switch depressed
  585. #define PDK_BARREL2             0x0004  // ditto 2
  586. #define PDK_BARREL3             0x0008  // ditto 3
  587. #define PDK_SWITCHES            0x000f  // sum of down + barrels 1,2,3
  588. #define PDK_TRANSITION          0x0010  // set by GetPenHwData
  589. #define PDK_UNUSED10            0x0020
  590. #define PDK_UNUSED20            0x0040
  591. #define PDK_INVERTED            0x0080  // other end of pen used as tip
  592. #define PDK_PENIDMASK           0x0F00  // bits 8..11 physical pen id (0..15)
  593. #define PDK_UNUSED1000          0x1000
  594. #define PDK_INKSTOPPED          0x2000  // Inking stopped
  595. #define PDK_OUTOFRANGE          0x4000  // pen left range (OEM data invalid)
  596. #define PDK_DRIVER              0x8000  // pen (not mouse) event
  597.  
  598. #define PDK_TIPMASK             0x0001  // mask for testing PDK_DOWN
  599.  
  600. // OEM-specific values for Pen Driver:
  601. #define PDT_NULL                0
  602. #define PDT_PRESSURE            1       // pressure supported
  603. #define PDT_HEIGHT              2       // height above tablet
  604. #define PDT_ANGLEXY             3       // xy (horiz) angle supported
  605. #define PDT_ANGLEZ              4       // z (vert) angle supported
  606. #define PDT_BARRELROTATION      5       // barrel is rotated
  607. #define PDT_OEMSPECIFIC         16      // max
  608.  
  609. // Denotes the ID of the current packet
  610. #define PID_CURRENT             (UINT)(-1)
  611.  
  612. // Recognition and GetPenHwData Returns:
  613. #define REC_OEM                 (-1024) // first recognizer-specific debug val
  614. #define REC_LANGUAGE            (-48)   // unsupported language field
  615. #define REC_GUIDE               (-47)   // invalid GUIDE struct
  616. #define REC_PARAMERROR          (-46)   // bad param
  617. #define REC_INVALIDREF          (-45)   // invalid data ref param
  618. #define REC_RECTEXCLUDE         (-44)   // invalid rect
  619. #define REC_RECTBOUND           (-43)   // invalid rect
  620. #define REC_PCM                 (-42)   // invalid lPcm parameter
  621. #define REC_RESULTMODE          (-41)
  622. #define REC_HWND                (-40)   // invalid window to send results to
  623. #define REC_ALC                 (-39)   // invalid enabled alphabet
  624. #define REC_ERRORLEVEL          (-38)   // invalid errorlevel
  625. #define REC_CLVERIFY            (-37)   // invalid verification level
  626. #define REC_DICT                (-36)   // invalid dict params
  627. #define REC_HREC                (-35)   // invalid recognition handle
  628. #define REC_BADEVENTREF         (-33)   // invalid wEventRef
  629. #define REC_NOCOLLECTION        (-32)   // collection mode not set
  630. #define REC_DEBUG               (-32)   // beginning of debug values
  631. #define REC_POINTEREVENT        (-31)   // tap or tap&hold event
  632. #define REC_BADHPENDATA         (-9)    // invalid hpendata header or locking
  633. #define REC_OOM                 (-8)    // out of memory error
  634. #define REC_NOINPUT             (-7)    // no data collected before termination
  635. #define REC_NOTABLET            (-6)    // tablet not physically present
  636. #define REC_BUSY                (-5)    // another task is using recognizer
  637. #define REC_BUFFERTOOSMALL      (-4)    // ret by GetPenHwEventData()
  638. #define REC_ABORT               (-3)    // recog stopped by EndPenCollection()
  639. #define REC_NA                  (-2)    // function not available
  640. #define REC_OVERFLOW            (-1)    // data overflow
  641. #define REC_OK                  0       // interrim completion
  642. #define REC_TERMBOUND           1       // hit outside bounding rect
  643. #define REC_TERMEX              2       // hit inside exclusion rect
  644. #define REC_TERMPENUP           3       // pen up
  645. #define REC_TERMRANGE           4       // pen left proximity
  646. #define REC_TERMTIMEOUT         5       // no writing for timeout ms
  647. #define REC_DONE                6       // normal completion
  648. #define REC_TERMOEM             512     // first recognizer-specific retval
  649.  
  650. #endif /*!NOPENDRIVER */
  651.  
  652. //---------------------------------------------------------------------------
  653. #ifndef NOPENHRC
  654.  
  655. // Handwriting Recognizer:
  656.  
  657. // GetResultsHRC options:
  658. #define GRH_ALL                 0       // get all results
  659. #define GRH_GESTURE             1       // get only gesture results
  660. #define GRH_NONGESTURE          2       // get all but gesture results
  661.  
  662. // Gesture sets for EnableGestureSetHRC (bit flags):
  663. #define GST_SEL                 0x00000001L   // sel & lasso
  664. #define GST_CLIP                0x00000002L   // cut copy paste
  665. #define GST_WHITE               0x00000004L   // sp tab ret
  666. #define GST_KKCONVERT           0x00000008L   // kkconvert
  667. #define GST_EDIT                0x00000010L   // insert correct undo clear
  668. #define GST_SYS                 0x00000017L   // all of the above
  669. #define GST_CIRCLELO            0x00000100L   // lowercase circle
  670. #define GST_CIRCLEUP            0x00000200L   // uppercase circle
  671. #define GST_CIRCLE              0x00000300L   // all circle
  672. #define GST_ALL                 0x00000317L   // all of the above
  673.  
  674. // General HRC API return values (HRCR_xx):
  675. #define HRCR_NORESULTS          4       // No possible results  to be found
  676. #define HRCR_COMPLETE           3       // finished recognition
  677. #define HRCR_GESTURE            2       // recognized gesture
  678. #define HRCR_OK                 1       // success
  679. #define HRCR_INCOMPLETE         0       // recognizer is processing input
  680. #define HRCR_ERROR              (-1)    // invalid param or unspecified error
  681. #define HRCR_MEMERR             (-2)    // memory error
  682. #define HRCR_INVALIDGUIDE       (-3)    // invalid GUIDE struct
  683. #define HRCR_INVALIDPNDT        (-4)    // invalid pendata
  684. #define HRCR_UNSUPPORTED        (-5)    // recognizer does not support feature
  685. #define HRCR_CONFLICT           (-6)    // training conflict
  686. #define HRCR_HOOKED             (-8)    // hookasaurus ate the result
  687.  
  688. // system wordlist for AddWordsHWL:
  689. #define HWL_SYSTEM              ((HWL)1)   // magic value means system wordlist
  690.  
  691. // inkset returns:
  692. #define ISR_ERROR               (-1)    // Memory or other error
  693. #define ISR_BADINKSET           (-2)    // bad source inkset
  694. #define ISR_BADINDEX            (-3)    // bad inkset index
  695.  
  696. #ifndef IX_END
  697. #define IX_END                  0xFFFF  // to or past last available index
  698. #endif //!IX_END
  699.  
  700. #define MAXHOTSPOT              8       // max number of hotspots possible
  701.  
  702. // ProcessHRC time constants:
  703. #define PH_MAX                  0xFFFFFFFFL   // recognize rest of ink
  704. #define PH_DEFAULT              0xFFFFFFFEL   // reasonable time
  705. #define PH_MIN                  0xFFFFFFFDL   // minimum time
  706.  
  707. // ResultsHookHRC options:
  708. #define RHH_STD                 0       // GetResultsHRC
  709. #define RHH_BOX                 1       // GetBoxResultsHRC
  710.  
  711. // SetWordlistCoercionHRC options:
  712. #define SCH_NONE                0       // turn off coercion
  713. #define SCH_ADVISE              1       // macro is hint only
  714. #define SCH_FORCE               2       // some result is forced from macro
  715.  
  716. // Symbol Context Insert Modes
  717. #define SCIM_INSERT             0       // insert
  718. #define SCIM_OVERWRITE          1       // overwrite
  719.  
  720. // SetResultsHookHREC options:
  721. #define SRH_HOOKALL             (HREC)1 // hook all recognizers
  722.  
  723. // SetInternationalHRC options:
  724. #define SSH_RD                  1       // to right and down (English)
  725. #define SSH_RU                  2       // to right and up
  726. #define SSH_LD                  3       // to left and down (Hebrew)
  727. #define SSH_LU                  4       // to left and up
  728. #define SSH_DL                  5       // down and to the left (Chinese)
  729. #define SSH_DR                  6       // down and to the right (Chinese)
  730. #define SSH_UL                  7       // up and to the left
  731. #define SSH_UR                  8       // up and to the right
  732.  
  733. #define SIH_ALLANSICHAR         1       // use all ANSI
  734.  
  735. // TrainHREC options:
  736. #define TH_QUERY                0       // query the user if conflict
  737. #define TH_FORCE                1       // ditto no query
  738. #define TH_SUGGEST              2       // abandon training if conflict
  739.  
  740. // Return values for WCR_TRAIN Function
  741. #define TRAIN_NONE              0x0000
  742. #define TRAIN_DEFAULT           0x0001
  743. #define TRAIN_CUSTOM            0x0002
  744. #define TRAIN_BOTH              (TRAIN_DEFAULT | TRAIN_CUSTOM)
  745.  
  746. // Control values for TRAINSAVE
  747. #define TRAIN_SAVE              0       // save changes that have been made
  748. #define TRAIN_REVERT            1       // discard changes that have been made
  749. #define TRAIN_RESET             2       // use factory settings
  750.  
  751. // ConfigRecognizer and ConfigHREC options:
  752. #define WCR_RECOGNAME           0       // ConfigRecognizer 1.0
  753. #define WCR_QUERY               1
  754. #define WCR_CONFIGDIALOG        2
  755. #define WCR_DEFAULT             3
  756. #define WCR_RCCHANGE            4
  757. #define WCR_VERSION             5
  758. #define WCR_TRAIN               6
  759. #define WCR_TRAINSAVE           7
  760. #define WCR_TRAINMAX            8
  761. #define WCR_TRAINDIRTY          9
  762. #define WCR_TRAINCUSTOM         10
  763. #define WCR_QUERYLANGUAGE       11
  764. #define WCR_USERCHANGE          12
  765.  
  766. // ConfigHREC options:
  767. #define WCR_PWVERSION           13      // ver of PenWin recognizer supports
  768. #define WCR_GETALCPRIORITY      14      // get recognizer's ALC priority
  769. #define WCR_SETALCPRIORITY      15      // set recognizer's ALC priority
  770. #define WCR_GETANSISTATE        16      // get ALLANSICHAR state
  771. #define WCR_SETANSISTATE        17      // set ALLANSICHAR if T
  772. #define WCR_GETHAND             18      // get writing hand
  773. #define WCR_SETHAND             19      // set writing hand
  774. #define WCR_GETDIRECTION        20      // get writing direction
  775. #define WCR_SETDIRECTION        21      // set writing direction
  776. #define WCR_INITRECOGNIZER      22      // init recognizer and set user name
  777. #define WCR_CLOSERECOGNIZER     23      // close recognizer
  778.  
  779. #define WCR_PRIVATE             1024
  780.  
  781. // sub-functions of WCR_USERCHANGE
  782. #define CRUC_NOTIFY             0       // user name change
  783. #define CRUC_REMOVE             1       // user name deleted
  784.  
  785. // Word List Types:
  786. #define WLT_STRING              0       // one string
  787. #define WLT_STRINGTABLE         1       // array of strings
  788. #define WLT_EMPTY               2       // empty wordlist
  789. #define WLT_WORDLIST            3       // handle to a wordlist
  790.  
  791. #endif /*!NOPENHRC */
  792.  
  793. //---------------------------------------------------------------------------
  794. #ifndef NOPENIEDIT
  795.  
  796. // IEdit Background Options
  797. #define IEB_DEFAULT             0       // default (use COLOR_WINDOW)
  798. #define IEB_BRUSH               1       // paint background with brush
  799. #define IEB_BIT_UL              2       // bitmap, upper-left aligned
  800. #define IEB_BIT_CENTER          3       // bitmap, centered in control
  801. #define IEB_BIT_TILE            4       // bitmap, tiled repeatedly in ctl
  802. #define IEB_BIT_STRETCH         5       // bitmap, stretched to fit ctl
  803. #define IEB_OWNERDRAW           6       // parent window will draw background
  804.  
  805. // IEdit Drawing Options
  806. #define IEDO_NONE               0x0000  // no drawing
  807. #define IEDO_FAST               0x0001  // ink drawn as fast as possible (def)
  808. #define IEDO_SAVEUPSTROKES      0x0002  // save upstrokes
  809. #define IEDO_RESERVED           0xFFFC  // reserved bits
  810.  
  811. // IEdit Input Options
  812. #define IEI_MOVE                0x0001  // move ink into ctl
  813. #define IEI_RESIZE              0x0002  // resize ink to fit within ctl
  814. #define IEI_CROP                0x0004  // discard ink outside of ctl
  815. #define IEI_DISCARD             0x0008  // discard all ink if any outside ctl
  816. #define IEI_RESERVED            0xFFF0  // reserved
  817.  
  818. // IEdit IE_GETINK options
  819. #define IEGI_ALL                0x0000  // get all ink from control
  820. #define IEGI_SELECTION          0x0001  // get selected ink from control
  821.  
  822. // IEdit IE_SETMODE/IE_GETMODE (mode) options
  823. #define IEMODE_READY            0       // default inking, moving, sizing mode
  824. #define IEMODE_ERASE            1       // erasing Mode
  825. #define IEMODE_LASSO            2       // lasso selection mode
  826.  
  827. // IEdit    Notification Bits
  828. #define IEN_NULL                0x0000  // null notification
  829. #define IEN_PDEVENT             0x0001  // notify about pointing device events
  830. #define IEN_PAINT               0x0002  // send painting-related notifications
  831. #define IEN_FOCUS               0x0004  // send focus-related notifications
  832. #define IEN_SCROLL              0x0008  // send scrolling notifications
  833. #define IEN_EDIT                0x0010  // send editing/change notifications
  834. #define IEN_PROPERTIES          0x0020  // send properties dialog notification
  835. #define IEN_RESERVED            0xFF80  // reserved
  836.  
  837. // IEdit Return Values
  838. #define IER_OK                  0       // success
  839. #define IER_NO                  0       // ctl cannot do request
  840. #define IER_YES                 1       // ctl can do request
  841. #define IER_ERROR               (-1)    // unspecified error; operation failed
  842. #define IER_PARAMERR            (-2)    // bogus lParam value, bad handle, etc
  843. #define IER_OWNERDRAW           (-3)    // can't set drawopts in ownerdraw ctl
  844. #define IER_SECURITY            (-4)    // security protection disallows action
  845. #define IER_SELECTION           (-5)    // nothing selected in control
  846. #define IER_SCALE               (-6)    // merge:  incompatible scaling factors
  847. #define IER_MEMERR              (-7)    // memory error
  848. #define IER_NOCOMMAND           (-8)    // tried IE_GETCOMMAND w/no command
  849. #define IER_NOGESTURE           (-9)    // tried IE_GETGESTURE w/no gesture
  850. #define IER_NOPDEVENT           (-10)   // tried IE_GETPDEVENT but no event
  851. #define IER_NOTINPAINT          (-11)   // tried IE_GETPAINTSTRUCT but no paint
  852. #define IER_PENDATA             (-12)   // can't do request with NULL hpd in ctl
  853.  
  854. // IEdit Recognition Options
  855. #define IEREC_NONE              0x0000  // No recognition
  856. #define IEREC_GESTURE           0x0001  // Gesture recognition
  857. #define IEREC_ALL               (IEREC_GESTURE)
  858. #define IEREC_RESERVED          0xFFFE  // Reserved
  859.  
  860. // IEdit Security Options
  861. #define IESEC_NOCOPY            0x0001  // copying disallowed
  862. #define IESEC_NOCUT             0x0002  // cutting disallowed
  863. #define IESEC_NOPASTE           0x0004  // pasting disallowed
  864. #define IESEC_NOUNDO            0x0008  // undoing disallowed
  865. #define IESEC_NOINK             0x0010  // inking  disallowed
  866. #define IESEC_NOERASE           0x0020  // erasing disallowed
  867. #define IESEC_NOGET             0x0040  // IE_GETINK message verboten
  868. #define IESEC_NOSET             0x0080  // IE_SETINK message verboten
  869. #define IESEC_RESERVED          0xFF00  // reserved
  870.  
  871. // IEdit IE_SETFORMAT/IE_GETFORMAT options
  872. #define IESF_ALL                0x0001  // set/get stk fmt of all ink
  873. #define IESF_SELECTION          0x0002  // set/get stk fmt of selected ink
  874. #define IESF_STROKE             0x0004  // set/get stk fmt of specified stroke
  875. //
  876. #define IESF_TIPCOLOR           0x0008  // set color
  877. #define IESF_TIPWIDTH           0x0010  // set width
  878. #define IESF_PENTIP             (IESF_TIPCOLOR|IESF_TIPWIDTH)
  879. //
  880.  
  881. // IEdit IE_SETINK options
  882. #define IESI_REPLACE            0x0000  // replace ink in control
  883. #define IESI_APPEND             0x0001  // append ink to existing control ink
  884.  
  885. // Ink Edit Control (IEdit) definitions
  886. // IEdit Notifications
  887. #define IN_PDEVENT      ((IEN_PDEVENT<<8)|0)   // pointing device event occurred
  888. #define IN_ERASEBKGND   ((IEN_NULL<<8)|1)      // control needs bkgnd erased
  889. #define IN_PREPAINT     ((IEN_PAINT<<8)|2)     // before control paints its ink
  890. #define IN_PAINT        ((IEN_NULL<<8)|3)      // control needs to be painted
  891. #define IN_POSTPAINT    ((IEN_PAINT<<8)|4)     // after control has painted
  892. #define IN_MODECHANGED  ((IEN_EDIT<<8)|5)      // mode changed
  893. #define IN_CHANGE       ((IEN_EDIT<<8)|6)      // contents changed & painted
  894. #define IN_UPDATE       ((IEN_EDIT<<8)|7)      // contents changed & !painted
  895. #define IN_SETFOCUS     ((IEN_FOCUS<<8)|8)     // IEdit is getting focus
  896. #define IN_KILLFOCUS    ((IEN_FOCUS<<8)|9)     // IEdit is losing focus
  897. #define IN_MEMERR       ((IEN_NULL<<8)|10)     // memory error
  898. #define IN_HSCROLL      ((IEN_SCROLL<<8)|11)   // horz scrolled, not painted
  899. #define IN_VSCROLL      ((IEN_SCROLL<<8)|12)   // vert scrolled, not painted
  900. #define IN_GESTURE      ((IEN_EDIT<<8)|13)     // user has gestured on control
  901. #define IN_COMMAND      ((IEN_EDIT<<8)|14)     // command selected from menu
  902. #define IN_CLOSE        ((IEN_NULL<<8)|15)     // I-Edit is being closed
  903. #define IN_PROPERTIES   ((IEN_PROPERTIES<<8)|16) // properties dialog
  904.  
  905. #endif /*!NOPENIEDIT */
  906.  
  907. //---------------------------------------------------------------------------
  908. #ifndef NOPENINKPUT
  909.  
  910. // PenIn[k]put API constants
  911.  
  912. // Default Processing
  913. #define LRET_DONE               1L
  914. #define LRET_ABORT              (-1L)
  915. #define LRET_HRC                (-2L)
  916. #define LRET_HPENDATA           (-3L)
  917. #define LRET_PRIVATE            (-4L)
  918.  
  919. // Inkput:
  920. #define PCMR_OK                 0
  921. #define PCMR_ALREADYCOLLECTING  (-1)
  922. #define PCMR_INVALIDCOLLECTION  (-2)
  923. #define PCMR_EVENTLOCK          (-3)
  924. #define PCMR_INVALID_PACKETID   (-4)
  925. #define PCMR_TERMTIMEOUT        (-5)
  926. #define PCMR_TERMRANGE          (-6)
  927. #define PCMR_TERMPENUP          (-7)
  928. #define PCMR_TERMEX             (-8)
  929. #define PCMR_TERMBOUND          (-9)
  930. #define PCMR_APPTERMINATED      (-10)
  931. #define PCMR_TAP                (-11)   // alias PCMR_TAPNHOLD_LAST
  932. #define PCMR_SELECT             (-12)   // ret because of tap & hold
  933. #define PCMR_OVERFLOW           (-13)
  934. #define PCMR_ERROR              (-14)   // parameter or unspecified error
  935. #define PCMR_DISPLAYERR         (-15)   // inking only
  936. #define PCMR_TERMINVERT         (-16)   // termination due to tapping opposite end of pen
  937.  
  938. #define PII_INKCLIPRECT         0x0001
  939. #define PII_INKSTOPRECT         0x0002
  940. #define PII_INKCLIPRGN          0x0004
  941. #define PII_INKSTOPRGN          0x0008
  942. #define PII_INKPENTIP           0x0010
  943. #define PII_SAVEBACKGROUND      0x0020
  944. #define PII_CLIPSTOP            0x0040
  945.  
  946. #define PIT_RGNBOUND            0x0001
  947. #define PIT_RGNEXCLUDE          0x0002
  948. #define PIT_TIMEOUT             0x0004
  949. #define PIT_TAPNHOLD            0x0008
  950.  
  951. #endif /*!NOPENINKPUT */
  952.  
  953. //---------------------------------------------------------------------------
  954. #ifndef NOPENMISC
  955.  
  956. // Misc RC Definitions:
  957. #define CL_NULL                 0
  958. #define CL_MINIMUM              1       // minimum confidence level
  959. #define CL_MAXIMUM              100     // max (require perfect recog)
  960. #define cwRcReservedMax         8       // rc.rgwReserved[cwRcReservedMax]
  961. #define ENUM_MINIMUM            1
  962. #define ENUM_MAXIMUM            4096
  963.  
  964. #define HKP_SETHOOK             0       // SetRecogHook()
  965. #define HKP_UNHOOK              0xFFFF
  966.  
  967. #define HWR_RESULTS             0
  968. #define HWR_APPWIDE             1
  969.  
  970. #define iSycNull                (-1)
  971. #define LPDFNULL                ((LPDF)NULL)
  972. #define MAXDICTIONARIES         16      // rc.rglpdf[MAXDICTIONARIES]
  973. #define wPntAll                 (UINT)0xFFFF
  974. #define cbRcLanguageMax         44      // rc.lpLanguage[cbRcLanguageMax]
  975. #define cbRcUserMax             32      // rc.lpUser[cbRcUserMax]
  976. #define cbRcrgbfAlcMax          32      // rc.rgbfAlc[cbRcrgbfAlcMax]
  977. #define RC_WDEFAULT             0xffff
  978. #define RC_LDEFAULT             0xffffffffL
  979. #define RC_WDEFAULTFLAGS        0x8000
  980. #define RC_LDEFAULTFLAGS        0x80000000L
  981.  
  982. // CorrectWriting() API constants:
  983. // LOWORD values:
  984. #define CWR_REPLACECR           0x0001  // replace carriage ret (\r) with space
  985. #define CWR_STRIPCR             CWR_REPLACECR  // alias for backward compatibility
  986. #define CWR_STRIPLF             0x0002  // strip linefeed (\n)
  987. #define CWR_REPLACETAB          0x0004  // replace tab with space (\t)
  988. #define CWR_STRIPTAB            CWR_REPLACETAB // alias for backward compatibility
  989. #define CWR_SINGLELINEEDIT      (CWR_REPLACECR|CWR_STRIPLF|CWR_REPLACETAB)  // all of the above
  990. #define CWR_INSERT              0x0008  // use "Insert Text" instead of "Edit Text" in the title
  991. #define CWR_TITLE               0x0010  // interpret dwParam as title string
  992. #define CWR_KKCONVERT           0x0020  // JPN initiate IME
  993. #define CWR_SIMPLE              0x0040  // simple dialog (lens)
  994. #define CWR_HEDIT               0x0080  // HEDIT CorrectWriting
  995. #define CWR_KEYBOARD            0x0100  // keyboard lens
  996. #define CWR_BOXES               0x0200  // bedit lens
  997.  
  998. // HIWORD values: keyboard types
  999. #define CWRK_DEFAULT            0       // default keyboard type
  1000. #define CWRK_BASIC              1       // basic keyboard
  1001. #define CWRK_FULL               2       // full keyboard
  1002. #define CWRK_NUMPAD             3       // numeric keyboard
  1003. #define CWRK_TELPAD             4       // Telephone type keyboard
  1004.  
  1005. #ifdef JAPAN
  1006. #define GPMI_OK                 0L
  1007. #define GPMI_INVALIDPMI         0x8000L
  1008. #endif // JAPAN
  1009.  
  1010. // inkwidth limits
  1011. #define INKWIDTH_MINIMUM        0           // 0 invisible, 1..15 pixel widths
  1012. #define INKWIDTH_MAXIMUM        15          // max width in pixels
  1013.  
  1014. // Get/SetPenMiscInfo:
  1015. // PMI_RCCHANGE is for WM_GLOBALRCCHANGE compatability only:
  1016. #define PMI_RCCHANGE            0       // invalid for Get/SetPenMiscInfo
  1017.  
  1018. #define PMI_BEDIT               1       // boxed edit info
  1019. #define PMI_IMECOLOR            2       // input method editor color
  1020. #define PMI_CXTABLET            3       // tablet width
  1021. #define PMI_CYTABLET            4       // tablet height
  1022. #define PMI_PENTIP              6       // pen tip: color, width, nib
  1023. #define PMI_ENABLEFLAGS         7       // PWE_xx enablements
  1024. #define PMI_TIMEOUT             8       // handwriting timeout
  1025. #define PMI_TIMEOUTGEST         9       // gesture timeout
  1026. #define PMI_TIMEOUTSEL          10      // select (press&hold) timeout
  1027. #define PMI_SYSFLAGS            11      // component load configuration
  1028. #define PMI_INDEXFROMRGB        12      // color table index from RGB
  1029. #define PMI_RGBFROMINDEX        13      // RGB from color table index
  1030. #define PMI_SYSREC              14      // handle to system recognizer
  1031. #define PMI_TICKREF             15      // reference absolute time
  1032.  
  1033. #define PMI_SAVE                0x1000  // save setting to file
  1034.  
  1035. // Set/GetPenMiscInfo/PMI_ENABLEFLAGS flags:
  1036. #define PWE_AUTOWRITE           0x0001  // pen functionality where IBeam
  1037. #define PWE_ACTIONHANDLES       0x0002  // action handles in controls
  1038. #define PWE_INPUTCURSOR         0x0004  // show cursor while writing
  1039. #define PWE_LENS                0x0008  // allow lens popup
  1040.  
  1041. // GetPenMiscInfo/PMI_SYSFLAGS flags:
  1042. #define PWF_RC1                 0x0001  // Windows for Pen 1.0 RC support
  1043. #define PWF_PEN                 0x0004  // pen drv loaded & hdwe init'd
  1044. #define PWF_INKDISPLAY          0x0008  // ink-compatible display drv loaded
  1045. #define PWF_RECOGNIZER          0x0010  // system recognizer installed
  1046. #define PWF_BEDIT               0x0100  // boxed edit support
  1047. #define PWF_HEDIT               0x0200  // free input edit support
  1048. #define PWF_IEDIT               0x0400  // ink edit support
  1049. #define PWF_ENHANCED            0x1000  // enh features (gest, 1ms timing)
  1050. #define PWF_FULL\
  1051.         PWF_RC1|PWF_PEN|PWF_INKDISPLAY|PWF_RECOGNIZER|\
  1052.         PWF_BEDIT|PWF_HEDIT |PWF_IEDIT|PWF_ENHANCED
  1053.  
  1054. // SetPenAppFlags() / RegisterPenApp() API constants:
  1055. #define RPA_DEFAULT             0x0001  // == RPA_HEDIT
  1056. #define RPA_HEDIT               0x0001  // convert EDIT to HEDIT
  1057. #define RPA_KANJIFIXEDBEDIT     0x0002
  1058. #define RPA_DBCSPRIORITY        0x0004  // assume DBCS has priority (Japan)
  1059.  
  1060. #define PMIR_OK                 0L
  1061. #define PMIR_INDEX              (-1L)
  1062. #define PMIR_VALUE              (-2L)
  1063. #define PMIR_INVALIDBOXEDITINFO (-3L)
  1064. #define PMIR_INIERROR           (-4L)
  1065. #define PMIR_ERROR              (-5L)
  1066. #define PMIR_NA                 (-6L)
  1067.  
  1068. #ifdef JAPAN
  1069. #define SPMI_OK                 0L
  1070. #define SPMI_INVALIDBOXEDITINFO 1L
  1071. #define SPMI_INIERROR           2L
  1072. #define SPMI_INVALIDPMI         0x8000L
  1073. #endif //JAPAN
  1074.  
  1075. #endif /*!NOPENMISC */
  1076.  
  1077. //---------------------------------------------------------------------------
  1078. #ifndef NOPENRC1    // not available in WIN32
  1079.  
  1080. // RC Options and Flags:
  1081. // GetGlobalRC() API return codes:
  1082. #define GGRC_OK                 0       // no err
  1083. #define GGRC_DICTBUFTOOSMALL    1       // lpDefDict buffer too small for path
  1084. #define GGRC_PARAMERROR         2       // invalid params: call ignored
  1085. #define GGRC_NA                 3       // function not available
  1086.  
  1087. // RC Direction:
  1088. #define RCD_DEFAULT             0       // def none
  1089. #define RCD_LR                  1       // left to right like English
  1090. #define RCD_RL                  2       // right to left like Arabic
  1091. #define RCD_TB                  3       // top to bottom like Japanese
  1092. #define RCD_BT                  4       // bottom to top like some Chinese
  1093.  
  1094. // RC International Preferences:
  1095. #define RCIP_ALLANSICHAR        0x0001  // all ANSI chars
  1096. #define RCIP_MASK               0x0001
  1097.  
  1098. // RC Options:
  1099. #define RCO_NOPOINTEREVENT      0x00000001L   // no recog tap, tap/hold
  1100. #define RCO_SAVEALLDATA         0x00000002L   // save pen data like upstrokes
  1101. #define RCO_SAVEHPENDATA        0x00000004L   // save pen data for app
  1102. #define RCO_NOFLASHUNKNOWN      0x00000008L   // no ? cursor on unknown
  1103. #define RCO_TABLETCOORD         0x00000010L   // tablet coords used in RC
  1104. #define RCO_NOSPACEBREAK        0x00000020L   // no space break recog -> dict
  1105. #define RCO_NOHIDECURSOR        0x00000040L   // display cursor during inking
  1106. #define RCO_NOHOOK              0x00000080L   // disallow ink hook (passwords)
  1107. #define RCO_BOXED               0x00000100L   // valid rc.guide provided
  1108. #define RCO_SUGGEST             0x00000200L   // for dict suggest
  1109. #define RCO_DISABLEGESMAP       0x00000400L   // disable gesture mapping
  1110. #define RCO_NOFLASHCURSOR       0x00000800L   // no cursor feedback
  1111. #define RCO_BOXCROSS            0x00001000L   // show + at boxedit center
  1112. #define RCO_COLDRECOG           0x00008000L   // result is from cold recog
  1113. #define RCO_SAVEBACKGROUND      0x00010000L   // Save background from ink
  1114. #define RCO_DODEFAULT           0x00020000L   // do default gesture processing
  1115.  
  1116. // RC Orientation of Tablet:
  1117. #define RCOR_NORMAL             1       // tablet not rotated
  1118. #define RCOR_RIGHT              2       // rotated 90 deg anticlockwise
  1119. #define RCOR_UPSIDEDOWN         3       // rotated 180 deg
  1120. #define RCOR_LEFT               4       // rotated 90 deg clockwise
  1121.  
  1122. // RC Preferences:
  1123. #define RCP_LEFTHAND            0x0001  // left handed input
  1124. #define RCP_MAPCHAR             0x0004  // fill in syg.lpsyc (ink) for training
  1125.  
  1126. // RCRESULT wResultsType values:
  1127. #define RCRT_DEFAULT            0x0000  // normal ret
  1128. #define RCRT_UNIDENTIFIED       0x0001  // result contains unidentified results
  1129. #define RCRT_GESTURE            0x0002  // result is a gesture
  1130. #define RCRT_NOSYMBOLMATCH      0x0004  // nothing recognized (no ink match)
  1131. #define RCRT_PRIVATE            0x4000  // recognizer-specific symbol
  1132. #define RCRT_NORECOG            0x8000  // no recog attempted, only data ret
  1133. #define RCRT_ALREADYPROCESSED   0x0008  // GestMgr hooked it
  1134. #define RCRT_GESTURETRANSLATED  0x0010  // GestMgr translated it to ANSI value
  1135. #define RCRT_GESTURETOKEYS      0x0020  // ditto to set of virtual keys
  1136.  
  1137. // RC Result Return Mode specification:
  1138. #define RRM_STROKE              0       // return results after each stroke
  1139. #define RRM_SYMBOL              1       // per symbol (e.g. boxed edits)
  1140. #define RRM_WORD                2       // on recog of a word
  1141. #define RRM_NEWLINE             3       // on recog of a line break
  1142. #define RRM_COMPLETE            16      // on PCM_xx specified completion
  1143.  
  1144. // SetGlobalRC() API return code flags:
  1145. #define SGRC_OK                 0x0000  // no err
  1146. #define SGRC_USER               0x0001  // invalid User name
  1147. #define SGRC_PARAMERROR         0x0002  // param error: call ignored
  1148. #define SGRC_RC                 0x0004  // supplied RC has errors
  1149. #define SGRC_RECOGNIZER         0x0008  // DefRecog name invalid
  1150. #define SGRC_DICTIONARY         0x0010  // lpDefDict path invalid
  1151. #define SGRC_INIFILE            0x0020  // error saving to penwin.ini
  1152. #define SGRC_NA                 0x8000  // function not available
  1153.  
  1154. #endif /*!NOPENRC1 */
  1155.  
  1156. //---------------------------------------------------------------------------
  1157.  
  1158. #ifndef NOPENTARGET
  1159.  
  1160. #define TPT_CLOSEST             0x0001   // Assign to the closest target
  1161. #define TPT_INTERSECTINK        0x0002   // target with intersecting ink
  1162. #define TPT_TEXTUAL             0x0004   // apply textual heuristics
  1163. #define TPT_DEFAULT             (TPT_TEXTUAL | TPT_INTERSECTINK | TPT_CLOSEST)
  1164.  
  1165. #endif /*!NOPENTARGET */
  1166.  
  1167. //---------------------------------------------------------------------------
  1168. #ifndef NOPENVIRTEVENT
  1169.  
  1170. // Virtual Event Layer:
  1171. #define VWM_MOUSEMOVE           0x0001
  1172. #define VWM_MOUSELEFTDOWN       0x0002
  1173. #define VWM_MOUSELEFTUP         0x0004
  1174. #define VWM_MOUSERIGHTDOWN      0x0008
  1175. #define VWM_MOUSERIGHTUP        0x0010
  1176. #endif /*!NOPENVIRTEVENT */
  1177.  
  1178. #endif /* RC_INVOKED */  // ... all the way back from definitions:2
  1179.  
  1180. /****** Messages and Defines ************************************************/
  1181.  
  1182. // Windows Messages WM_PENWINFIRST (0x0380) and WM_PENWINLAST (0x038F)
  1183. // are defined in WINDOWS.H and WINMIN.H
  1184.  
  1185. //---------------------------------------------------------------------------
  1186. #ifndef NOPENMSGS
  1187.  
  1188. #ifndef NOPENRC1    // not available in WIN32
  1189. #define WM_RCRESULT             (WM_PENWINFIRST+1)  // 0x381
  1190. #define WM_HOOKRCRESULT         (WM_PENWINFIRST+2)  // 0x382
  1191. #endif /*!NOPENRC1*/
  1192.  
  1193. #define WM_PENMISCINFO          (WM_PENWINFIRST+3)  // 0x383
  1194. #define WM_GLOBALRCCHANGE       (WM_PENWINFIRST+3)  // alias
  1195.  
  1196. #ifndef NOPENAPPS   // not available in WIN32
  1197. #define WM_SKB                  (WM_PENWINFIRST+4)  // 0x384
  1198. #endif /*!NOPENAPPS */
  1199.  
  1200. #define WM_PENCTL               (WM_PENWINFIRST+5)  // 0x385
  1201. #define WM_HEDITCTL             (WM_PENWINFIRST+5)  // FBC: alias
  1202.  
  1203. // WM_HEDITCTL (WM_PENCTL) wParam options:
  1204. #ifndef _WIN32
  1205. #define HE_GETRC                3       // FBC: get RC from HEDIT/BEDIT control
  1206. #define HE_SETRC                4       // FBC: ditto set
  1207. #define HE_GETINFLATE           5       // FBC: get inflate rect
  1208. #define HE_SETINFLATE           6       // FBC: ditto set
  1209. #endif //!_WIN32
  1210. #define HE_GETUNDERLINE         7       // get underline mode
  1211. #define HE_SETUNDERLINE         8       // ditto set
  1212. #define HE_GETINKHANDLE         9       // get handle to captured ink
  1213. #define HE_SETINKMODE           10      // begin HEDIT cold recog mode
  1214. #define HE_STOPINKMODE          11      // end cold recog mode
  1215. #ifndef _WIN32
  1216. #define HE_GETRCRESULTCODE      12      // FBC: result of recog after HN_ENDREC
  1217. #endif //!_WIN32
  1218. #define HE_DEFAULTFONT          13      // switch BEDIT to def font
  1219. #define HE_CHARPOSITION         14      // BEDIT byte offset -> char position
  1220. #define HE_CHAROFFSET           15      // BEDIT char position -> byte offset
  1221. #define HE_GETBOXLAYOUT         20      // get BEDIT layout
  1222. #define HE_SETBOXLAYOUT         21      // ditto set
  1223. #ifndef _WIN32
  1224. #define HE_GETRCRESULT          22      // FBC: get RCRESULT after HN_RCRESULT
  1225. #define HE_KKCONVERT            30      // JPN start kana-kanji conversion
  1226. #define HE_GETKKCONVERT         31      // JPN get KK state
  1227. #define HE_CANCELKKCONVERT      32      // JPN cancel KK conversion
  1228. #define HE_FIXKKCONVERT         33      // JPN force KK result
  1229. #define HE_GETKKSTATUS          34      // JPN get KK UI state
  1230. #define HE_KKNOCONVERT          35      // JPN revert conversion
  1231. #define HE_SETIMEDEFAULT        36      // JPN set a range of DCS
  1232. #define HE_GETIMEDEFAULT        37      // JPN get a range of DCS
  1233. #endif //!_WIN32
  1234. #define HE_ENABLEALTLIST        40      // en/disable dropdown recog alt's
  1235. #define HE_SHOWALTLIST          41      // show dropdown (assume enabled)
  1236. #define HE_HIDEALTLIST          42      // hide dropdown alternatives
  1237. #define HE_GETLENSTYPE          43      // get lens type: CWR_ and CWRK_ flags
  1238. #define HE_SETLENSTYPE          44      // set lens type: CWR_ and CWRK_ flags
  1239.  
  1240. //------------------------------
  1241. // JPN Kana-to-Kanji conversion subfunctions:
  1242. #define HEKK_DEFAULT            0       // def
  1243. #define HEKK_CONVERT            1       // convert in place
  1244. #define HEKK_CANDIDATE          2       // start conversion dialog
  1245. #define HEKK_DBCSCHAR           3       // convert to DBCS
  1246. #define HEKK_SBCSCHAR           4       // convert to SBCS
  1247. #define HEKK_HIRAGANA           5       // convert to hiragana
  1248. #define HEKK_KATAKANA           6       // convert to katakana
  1249.  
  1250. //------------------------------
  1251. // JPN Return value of HE_GETKKSTATUS
  1252. #define HEKKR_PRECONVERT        1       // in pre conversion mode
  1253. #define HEKKR_CONVERT           2       // in mid conversion mode
  1254. #define HEKKR_TEMPCONFIRM       3       // in post conversion mode
  1255.  
  1256. // HE_STOPINKMODE (stop cold recog) options:
  1257. #define HEP_NORECOG             0       // don't recog ink
  1258. #define HEP_RECOG               1       // recog ink
  1259. #define HEP_WAITFORTAP          2       // recog after tap in window
  1260.  
  1261. // WM_PENCTL notifications:
  1262. #define HN_ENDREC               4       // recog complete
  1263. #define HN_DELAYEDRECOGFAIL     5       // HE_STOPINKMODE (cold recog) failed
  1264. #define HN_RESULT               20      // HEDIT/BEDIT has received new ink/recognition result
  1265. #ifndef _WIN32
  1266. #define HN_RCRESULT             HN_RESULT
  1267. #endif //!_WIN32
  1268. #define HN_ENDKKCONVERT         30      // JPN KK conversion complete
  1269. #define HN_BEGINDIALOG          40      // Lens/EditText/garbage detection dialog
  1270.                                         //  is about to come up on this hedit/bedit
  1271. #define HN_ENDDIALOG            41      // Lens/EditText/garbage detection dialog
  1272.                                         //  has just been destroyed
  1273.  
  1274. //------------------------------
  1275. #ifndef NOPENIEDIT
  1276.  
  1277. // Messages common with other controls:
  1278. #define IE_GETMODIFY          (EM_GETMODIFY)    // gets the mod'n (dirty) bit
  1279. #define IE_SETMODIFY          (EM_SETMODIFY)    // sets the mod'n (dirty) bit
  1280. #define IE_CANUNDO            (EM_CANUNDO)      // queries whether can undo
  1281. #define IE_UNDO               (EM_UNDO)         // undo
  1282. #define IE_EMPTYUNDOBUFFER    (EM_EMPTYUNDOBUFFER) // clears IEDIT undo buffer
  1283.  
  1284. #define IE_MSGFIRST           (WM_USER+150)     // 0x496 == 1174
  1285.  
  1286. // IEdit common messages:
  1287. #define IE_GETINK             (IE_MSGFIRST+0)   // gets ink from the control
  1288. #define IE_SETINK             (IE_MSGFIRST+1)   // sets ink into the control
  1289. #define IE_GETPENTIP          (IE_MSGFIRST+2)   // gets the cur def ink pentip
  1290. #define IE_SETPENTIP          (IE_MSGFIRST+3)   // sets the cur def ink pentip
  1291. #define IE_GETERASERTIP       (IE_MSGFIRST+4)   // gets the cur eraser pentip
  1292. #define IE_SETERASERTIP       (IE_MSGFIRST+5)   // sets the cur eraser pentip
  1293. #define IE_GETBKGND           (IE_MSGFIRST+6)   // gets the bkgnd options
  1294. #define IE_SETBKGND           (IE_MSGFIRST+7)   // sets the bkgnd options
  1295. #define IE_GETGRIDORIGIN      (IE_MSGFIRST+8)   // gets the bkgnd grid origin
  1296. #define IE_SETGRIDORIGIN      (IE_MSGFIRST+9)   // sets the bkgnd grid origin
  1297. #define IE_GETGRIDPEN         (IE_MSGFIRST+10)  // gets the bkgnd grid pen
  1298. #define IE_SETGRIDPEN         (IE_MSGFIRST+11)  // sets the bkgnd grid pen
  1299. #define IE_GETGRIDSIZE        (IE_MSGFIRST+12)  // gets the bkgnd grid size
  1300. #define IE_SETGRIDSIZE        (IE_MSGFIRST+13)  // sets the bkgnd grid size
  1301. #define IE_GETMODE            (IE_MSGFIRST+14)  // gets the current pen mode
  1302. #define IE_SETMODE            (IE_MSGFIRST+15)  // sets the current pen mode
  1303. #define IE_GETINKRECT         (IE_MSGFIRST+16)  // gets the rectbound of the ink
  1304.  
  1305. // IEdit-specific messages:
  1306. #define IE_GETAPPDATA         (IE_MSGFIRST+34)  // gets the user-defined datum
  1307. #define IE_SETAPPDATA         (IE_MSGFIRST+35)  // sets the user-defined data
  1308. #define IE_GETDRAWOPTS        (IE_MSGFIRST+36)  // gets the ink draw options
  1309. #define IE_SETDRAWOPTS        (IE_MSGFIRST+37)  // sets the ink options
  1310. #define IE_GETFORMAT          (IE_MSGFIRST+38)  // gets format of stroke(s)
  1311. #define IE_SETFORMAT          (IE_MSGFIRST+39)  // sets format of stroke(s)
  1312. #define IE_GETINKINPUT        (IE_MSGFIRST+40)  // gets the ink input option
  1313. #define IE_SETINKINPUT        (IE_MSGFIRST+41)  // sets the ink input option
  1314. #define IE_GETNOTIFY          (IE_MSGFIRST+42)  // gets the notification bits
  1315. #define IE_SETNOTIFY          (IE_MSGFIRST+43)  // sets the notification bits
  1316. #define IE_GETRECOG           (IE_MSGFIRST+44)  // gets recognition options
  1317. #define IE_SETRECOG           (IE_MSGFIRST+45)  // sets recognition options
  1318. #define IE_GETSECURITY        (IE_MSGFIRST+46)  // gets the security options
  1319. #define IE_SETSECURITY        (IE_MSGFIRST+47)  // sets the security options
  1320. #define IE_GETSEL             (IE_MSGFIRST+48)  // gets sel status of a stroke
  1321. #define IE_SETSEL             (IE_MSGFIRST+49)  // sets sel status of a stroke
  1322. #define IE_DOCOMMAND          (IE_MSGFIRST+50)  // send command to IEdit
  1323. #define IE_GETCOMMAND         (IE_MSGFIRST+51)  // gets user command
  1324. #define IE_GETCOUNT           (IE_MSGFIRST+52)  // gets count of strks in I-Edit
  1325. #define IE_GETGESTURE         (IE_MSGFIRST+53)  // gets details on user gesture
  1326. #define IE_GETMENU            (IE_MSGFIRST+54)  // gets handle to pop-up menu
  1327. #define IE_GETPAINTDC         (IE_MSGFIRST+55)  // gets the HDC for painting
  1328. #define IE_GETPDEVENT         (IE_MSGFIRST+56)  // gets details of last pd event
  1329. #define IE_GETSELCOUNT        (IE_MSGFIRST+57)  // gets count of selected strks
  1330. #define IE_GETSELITEMS        (IE_MSGFIRST+58)  // gets indices of all sel strks
  1331. #define IE_GETSTYLE           (IE_MSGFIRST+59)  // gets IEdit control styles
  1332.  
  1333. #endif /*!NOPENIEDIT */
  1334.  
  1335. //------------------------------
  1336. #ifndef NOPENHEDIT
  1337.  
  1338. // (H)Edit Control:
  1339. // CTLINITHEDIT.dwFlags values
  1340. #define CIH_NOGDMSG           0x0001  // disable garbage detection message box for this edit
  1341. #define CIH_NOACTIONHANDLE    0x0002  // disable action handles for this edit
  1342. #define CIH_NOEDITTEXT        0x0004  // disable Lens/Edit/Insert text for this edit
  1343. #define CIH_NOFLASHCURSOR     0x0008  // don't flash cursor on tap-n-hold in this (h)edit
  1344.  
  1345. #endif /* !NOPENHEDIT */
  1346.  
  1347. //------------------------------
  1348. #ifndef NOPENBEDIT
  1349.  
  1350. // Boxed Edit Control:
  1351. // box edit alternative list:
  1352. #define HEAL_DEFAULT            -1L     // AltList def value for lParam
  1353.  
  1354. // box edit Info:
  1355. #define BEI_FACESIZE            32      // max size of font name, = LF_FACESIZE
  1356. #define BEIF_BOXCROSS           0x0001
  1357.  
  1358. // box edit size:
  1359. #define BESC_DEFAULT            0
  1360. #define BESC_ROMANFIXED         1
  1361. #define BESC_KANJIFIXED         2
  1362. #define BESC_USERDEFINED        3
  1363.  
  1364. // CTLINITBEDIT.wFlags values
  1365. #define CIB_NOGDMSG           0x0001  // disable garbage detection message box for this bedit
  1366. #define CIB_NOACTIONHANDLE    0x0002  // disable action handles for this bedit
  1367. #define CIB_NOFLASHCURSOR     0x0004  // don't flash cursor on tap-n-hold in this bedit
  1368. #ifdef JAPAN
  1369. #define CIB_NOWRITING         0x0010  // disallow pen input into control
  1370. #endif // JAPAN
  1371.  
  1372. #define BXD_CELLWIDTH           12
  1373. #define BXD_CELLHEIGHT          16
  1374. #define BXD_BASEHEIGHT          13
  1375. #define BXD_BASEHORZ            0
  1376. #define BXD_MIDFROMBASE         0
  1377. #define BXD_CUSPHEIGHT          2
  1378. #define BXD_ENDCUSPHEIGHT       4
  1379.  
  1380. #define BXDK_CELLWIDTH          32
  1381. #define BXDK_CELLHEIGHT         32
  1382. #define BXDK_BASEHEIGHT         28
  1383. #define BXDK_BASEHORZ           0
  1384. #define BXDK_MIDFROMBASE        0
  1385. #define BXDK_CUSPHEIGHT         28
  1386. #define BXDK_ENDCUSPHEIGHT      10
  1387.  
  1388. #ifdef JAPAN
  1389. // IME colors for bedit
  1390. #define COLOR_BE_INPUT             0
  1391. #define COLOR_BE_INPUT_TEXT        1
  1392. #define COLOR_BE_CONVERT           2
  1393. #define COLOR_BE_CONVERT_TEXT      3
  1394. #define COLOR_BE_CONVERTED         4
  1395. #define COLOR_BE_CONVERTED_TEXT    5
  1396. #define COLOR_BE_UNCONVERT         6
  1397. #define COLOR_BE_UNCONVERT_TEXT    7
  1398. #define COLOR_BE_CURSOR            8
  1399. #define COLOR_BE_CURSOR_TEXT       9
  1400. #define COLOR_BE_PRECONVERT        10
  1401. #define COLOR_BE_PRECONVERT_TEXT   11
  1402. #define MAXIMECOLORS               12
  1403. #endif
  1404.  
  1405. #endif /*!NOPENBEDIT */
  1406.  
  1407. #define WM_PENMISC              (WM_PENWINFIRST+6)  // 0x386
  1408.  
  1409. // WM_PENMISC message constants:
  1410. #define PMSC_BEDITCHANGE        1       // broadcast when BEDIT changes
  1411. #ifndef _WIN32
  1412. //#define PMSC_PENUICHANGE      2       // JPN broadcast when PENUI changes
  1413. //#define PMSC_SUBINPCHANGE     3       // JPN broadcast when SUBINPUT changes
  1414. //#define PMSC_KKCTLENABLE      4       // JPN
  1415. #endif //!_WIN32
  1416. #define PMSC_GETPCMINFO         5       // query the window's PCMINFO
  1417. #define PMSC_SETPCMINFO         6       // set the window's PCMINFO
  1418. #define PMSC_GETINKINGINFO      7       // query the window's INKINGINFO
  1419. #define PMSC_SETINKINGINFO      8       // set the window's INKINGINFO
  1420. #define PMSC_GETHRC             9       // query the window's HRC
  1421. #define PMSC_SETHRC             10      // set the window's HRC
  1422. #define PMSC_GETSYMBOLCOUNT     11      // count of symbols in result recd by window
  1423. #define PMSC_GETSYMBOLS         12      // ditto symbols
  1424. #define PMSC_SETSYMBOLS         13      // ditto set symbols
  1425. #define PMSC_LOADPW             15      // broadcast load state on penwin
  1426. #define PMSC_INKSTOP            16
  1427.  
  1428. // PMSCL_xx lParam values for PMSC_xx:
  1429. #define PMSCL_UNLOADED          0L      // penwin just unloaded
  1430. #define PMSCL_LOADED            1L      // penwin just loaded
  1431. #define PMSCL_UNLOADING         2L      // penwin about to unload
  1432.  
  1433. #define WM_CTLINIT              (WM_PENWINFIRST+7)  // 0x387
  1434.  
  1435. // WM_CTLINIT message constants:
  1436. #define CTLINIT_HEDIT           1
  1437. #define CTLINIT_BEDIT           7
  1438. #define CTLINIT_IEDIT           9
  1439. #define CTLINIT_MAX             10
  1440.  
  1441. #define WM_PENEVENT             (WM_PENWINFIRST+8)  // 0x388
  1442.  
  1443. // WM_PENEVENT message values for wParam:
  1444. #define PE_PENDOWN              1       // pen tip down
  1445. #define PE_PENUP                2       // pen tip went from down to up
  1446. #define PE_PENMOVE              3       // pen moved without a tip transition
  1447. #define PE_TERMINATING          4       // Peninput about to terminate
  1448. #define PE_TERMINATED           5       // Peninput terminated
  1449. #define PE_BUFFERWARNING        6       // Buffer half full.
  1450. #define PE_BEGININPUT           7       // begin default input
  1451. #define PE_SETTARGETS           8       // set target data structure (TARGINFO)
  1452. #define PE_BEGINDATA            9       // init message to all targets
  1453. #define PE_MOREDATA             10      // target gets more data
  1454. #define PE_ENDDATA              11      // termination message to all targets
  1455. #define PE_GETPCMINFO           12      // get input collection info
  1456. #define PE_GETINKINGINFO        13      // get inking info
  1457. #define PE_ENDINPUT             14      // Input termination message to window
  1458.                                         //  starting default input
  1459. #define PE_RESULT               15      // sent after ProcessHRC but before GetResultsHRC
  1460.  
  1461. #endif /*!NOPENMSGS */
  1462.  
  1463. /****** Definitions 3: RC compiler excluded ********************************/
  1464.  
  1465. #ifndef RC_INVOKED  // ... rest of file of no interest to rc compiler
  1466.  
  1467. //////////////////////////////////////////////////////////////////////////////
  1468. /****** Macros **************************************************************/
  1469.  
  1470. // misc macros:
  1471. //---------------------------------------------------------------------------
  1472. #ifndef NOPENDRIVER
  1473.  
  1474. #define FPenUpX(x)              ((BOOL)(((x) & BITPENUP) != 0))
  1475. #define GetWEventRef()          (LOWORD(GetMessageExtraInfo()))
  1476. #endif /*!NOPENDRIVER */
  1477.  
  1478. //---------------------------------------------------------------------------
  1479. #ifndef NOPENALC
  1480.  
  1481. // ALC macros:
  1482.  
  1483. #define MpAlcB(lprc,i)          ((lprc)->rgbfAlc[((i) & 0xff) >> 3])
  1484. #define MpIbf(i)                ((BYTE)(1 << ((i) & 7)))
  1485. #define SetAlcBitAnsi(lprc,i)   do {MpAlcB(lprc,i) |= MpIbf(i);} while (0)
  1486. #define ResetAlcBitAnsi(lprc,i) do {MpAlcB(lprc,i) &= ~MpIbf(i);} while (0)
  1487. #define IsAlcBitAnsi(lprc, i)   ((MpAlcB(lprc,i) & MpIbf(i)) != 0)
  1488. #endif /*!NOPENALC */
  1489.  
  1490. //---------------------------------------------------------------------------
  1491. #ifndef NOPENDATA
  1492.  
  1493. // draw 2.0 pendata using internal stroke formats:
  1494. #define DrawPenDataFmt(hdc, lprect, hpndt)\
  1495.     DrawPenDataEx(hdc, lprect, hpndt, 0, IX_END, 0, IX_END, NULL, NULL, 0)
  1496.  
  1497. #endif /*!NOPENDATA */
  1498.  
  1499. //---------------------------------------------------------------------------
  1500. #ifndef NOPENHRC
  1501.  
  1502. // Handwriting Recognizer:
  1503.  
  1504. // Intervals:
  1505. // difference of two absolute times (at2 > at1 for positive result):
  1506. #define dwDiffAT(at1, at2)\
  1507.     (1000L*((at2).sec - (at1).sec) - (DWORD)(at1).ms + (DWORD)(at2).ms)
  1508.  
  1509. // comparison of two absolute times (TRUE if at1 < at2):
  1510. #define FLTAbsTime(at1, at2)\
  1511.     ((at1).sec < (at2).sec || ((at1).sec == (at2).sec && (at1).ms < (at2).ms))
  1512.  
  1513. #define FLTEAbsTime(at1, at2)\
  1514.     ((at1).sec < (at2).sec || ((at1).sec == (at2).sec && (at1).ms <= (at2).ms))
  1515.  
  1516. #define FEQAbsTime(at1, at2)\
  1517.     ((at1).sec == (at2).sec && (at1).ms == (at2).ms)
  1518.  
  1519. // test if abstime is within an interval:
  1520. #define FAbsTimeInInterval(at, lpi)\
  1521.     (FLTEAbsTime((lpi)->atBegin, at) && FLTEAbsTime(at, (lpi)->atEnd))
  1522.  
  1523. // test if interval (lpiT) is within an another interval (lpiS):
  1524. #define FIntervalInInterval(lpiT, lpiS)\
  1525.     (FLTEAbsTime((lpiS)->atBegin, (lpiT)->atBegin)\
  1526.     && FLTEAbsTime((lpiT)->atEnd, (lpiS)->atEnd))
  1527.  
  1528. // test if interval (lpiT) intersects another interval (lpiS):
  1529. #define FIntervalXInterval(lpiT, lpiS)\
  1530.     (!(FLTAbsTime((lpiT)->atEnd, (lpiS)->atBegin)\
  1531.     || FLTAbsTime((lpiS)->atEnd, (lpiT)->atBegin)))
  1532.  
  1533. // duration of an LPINTERVAL in ms:
  1534. #define dwDurInterval(lpi)  dwDiffAT((lpi)->atBegin, (lpi)->atEnd)
  1535.  
  1536. // fill a pointer to an ABSTIME structure from a count of seconds and ms:
  1537. #define MakeAbsTime(lpat, sec, ms) do {\
  1538.     (lpat)->sec = sec + ((ms) / 1000);\
  1539.     (lpat)->ms = (ms) % 1000;\
  1540.     } while (0)
  1541.  
  1542. // SYV macros:
  1543. #define FIsSpecial(syv)         (HIWORD((syv))==SYVHI_SPECIAL)
  1544. #define FIsAnsi(syv)            (HIWORD((syv))==SYVHI_ANSI)
  1545. #define FIsGesture(syv)         (HIWORD((syv))==SYVHI_GESTURE)
  1546. #define FIsKanji(syv)           (HIWORD((syv))==SYVHI_KANJI)
  1547. #define FIsShape(syv)           (HIWORD((syv))==SYVHI_SHAPE)
  1548. #define FIsUniCode(syv)         (HIWORD((syv))==SYVHI_UNICODE)
  1549. #define FIsVKey(syv)            (HIWORD((syv))==SYVHI_VKEY)
  1550.  
  1551. #define ChSyvToAnsi(syv)        ((BYTE) (LOBYTE(LOWORD((syv)))))
  1552. #define WSyvToKanji(syv)        ((WORD) (LOWORD((syv))))
  1553. #define SyvCharacterToSymbol(c) ((LONG)(unsigned char)(c) | 0x00010000)
  1554. #define SyvKanjiToSymbol(c)     ((LONG)(UINT)(c) | 0x00030000)
  1555.  
  1556. #define FIsSelectGesture(syv)   \
  1557.    ((syv) >= SYVSELECTFIRST && (syv) <= SYVSELECTLAST)
  1558.  
  1559. #define FIsStdGesture(syv)      \
  1560.    (                            \
  1561.    FIsSelectGesture(syv)        \
  1562.    || (syv)==SYV_CLEAR          \
  1563.    || (syv)==SYV_HELP           \
  1564.    || (syv)==SYV_EXTENDSELECT   \
  1565.    || (syv)==SYV_UNDO           \
  1566.    || (syv)==SYV_COPY           \
  1567.    || (syv)==SYV_CUT            \
  1568.    || (syv)==SYV_PASTE          \
  1569.    || (syv)==SYV_CLEARWORD      \
  1570.    || (syv)==SYV_KKCONVERT      \
  1571.    || (syv)==SYV_USER           \
  1572.    || (syv)==SYV_CORRECT        \
  1573.    )
  1574.  
  1575. #define FIsAnsiGesture(syv) \
  1576.    (                            \
  1577.    (syv) == SYV_BACKSPACE       \
  1578.    || (syv) == SYV_TAB          \
  1579.    || (syv) == SYV_RETURN       \
  1580.    || (syv) == SYV_SPACE        \
  1581.    )
  1582.  
  1583. #endif /*!NOPENHRC */
  1584.  
  1585. //---------------------------------------------------------------------------
  1586. #ifndef NOPENINKPUT
  1587.  
  1588. #define SubPenMsgFromWpLp(wp, lp)       (LOWORD(wp))
  1589. #ifdef _WIN32
  1590. #define EventRefFromWpLp(wp, lp)        (HIWORD(wp))
  1591. #define TerminationFromWpLp(wp, lp)     ((int)HIWORD(wp))
  1592. #define HpcmFromWpLp(wp, lp)            ((HPCM)(lp))
  1593. #else
  1594. #define EventRefFromWpLp(wp, lp)        (LOWORD(lp))
  1595. #define TerminationFromWpLp(wp, lp)     ((int)LOWORD(lp))
  1596. #define HpcmFromWpLp(wp, lp)            ((HPCM)HIWORD(lp))
  1597. #endif //_WIN32
  1598.  
  1599. #endif   /*!NOPENINKPUT*/
  1600.  
  1601. //---------------------------------------------------------------------------
  1602. #ifndef NOPENTARGET
  1603. #define HwndFromHtrg(htrg)      ((HWND)(DWORD)(htrg))
  1604. #define HtrgFromHwnd(hwnd)      ((HTRG)(UINT)(hwnd))
  1605. #endif /*!NOPENTARGET*/
  1606.  
  1607. //////////////////////////////////////////////////////////////////////////////
  1608. /****** Typedefs ************************************************************/
  1609.  
  1610. // Simple:
  1611. typedef LONG                    ALC;    // Enabled Alphabet
  1612. typedef int                     CL;     // Confidence Level
  1613. typedef UINT                    HKP;    // Hook Parameter
  1614. typedef int                     REC;    // recognition result
  1615. typedef LONG                    SYV;    // Symbol Value
  1616.  
  1617. #ifndef DECLARE_HANDLE32
  1618. #define DECLARE_HANDLE32(name)\
  1619.     struct name##__ { int unused; };\
  1620.     typedef const struct name##__ FAR* name
  1621. #endif //!DECLARE_HANDLE32
  1622.  
  1623. DECLARE_HANDLE32(HTRG);                 // Handle to target
  1624. DECLARE_HANDLE(HPCM);                   // Handle to Pen Collection Info
  1625. DECLARE_HANDLE(HPENDATA);               // handle to ink
  1626. DECLARE_HANDLE(HREC);                   // handle to recognizer
  1627.  
  1628. // Pointer Types:
  1629. typedef ALC FAR*                LPALC;        // ptr to ALC
  1630. typedef LPVOID                  LPOEM;        // alias
  1631. typedef SYV FAR*                LPSYV;        // ptr to SYV
  1632. typedef HPENDATA FAR*           LPHPENDATA;   // ptr to HPENDATA
  1633.  
  1634. // Function Prototypes:
  1635. typedef int         (CALLBACK *ENUMPROC)(LPSYV, int, VOID FAR*);
  1636. typedef int         (CALLBACK *LPDF)(int, LPVOID, LPVOID, int, DWORD, DWORD);
  1637. typedef BOOL        (CALLBACK *RCYIELDPROC)(VOID);
  1638.  
  1639. // Structures:
  1640.  
  1641. typedef struct tagABSTIME       // 2.0 absolute date/time
  1642.    {
  1643.    DWORD sec;      // number of seconds since 1/1/1970, ret by CRTlib time() fn
  1644.    UINT ms;        // additional offset in ms, 0..999
  1645.    }
  1646.    ABSTIME, FAR *LPABSTIME;
  1647.  
  1648. //---------------------------------------------------------------------------
  1649. #ifndef NOPENHEDIT
  1650.  
  1651. typedef struct tagCTLINITHEDIT  // 2.0 init struct for (h)edit
  1652.    {
  1653.    DWORD cbSize;                // sizeof(CTLINITHEDIT)
  1654.    HWND hwnd;                   // (h)edit window handle
  1655.    int id;                      // its id
  1656.    DWORD dwFlags;               // CIE_xx
  1657.    DWORD dwReserved;            // for future use
  1658.    }
  1659.    CTLINITHEDIT, FAR *LPCTLINITHEDIT;
  1660. #endif /* !NOPENHEDIT */
  1661.  
  1662. //---------------------------------------------------------------------------
  1663. #ifndef NOPENBEDIT
  1664.  
  1665. typedef struct tagBOXLAYOUT     // 1.0 box edit layout
  1666.    {
  1667.    int cyCusp;                  // pixel height of box (BXS_RECT) or cusp
  1668.    int cyEndCusp;               // pixel height of cusps at extreme ends
  1669.    UINT style;                  // BXS_xx style
  1670.    DWORD dwReserved1;           // reserved
  1671.    DWORD dwReserved2;           // reserved
  1672.    DWORD dwReserved3;           // reserved
  1673.    }
  1674.    BOXLAYOUT, FAR *LPBOXLAYOUT;
  1675.  
  1676. typedef struct tagIMECOLORS     // 2.0 IME undetermined string color info.
  1677.    {
  1678.    int cColors;                 // count of colors to be set/get
  1679.    LPINT lpnElem;               // address of array of elements
  1680.    COLORREF FAR *lprgbIme;      // address of array of RGB values
  1681.    }
  1682.    IMECOLORS, FAR *LPIMECOLORS;
  1683.  
  1684. typedef struct tagCTLINITBEDIT  // 2.0 init struct for box edit
  1685.    {
  1686.    DWORD cbSize;                // sizeof(CTLINITBEDIT)
  1687.    HWND hwnd;                   // box edit window handle
  1688.    int id;                      // its id
  1689.    WORD wSizeCategory;          // BESC_xx
  1690.    WORD wFlags;                 // CIB_xx
  1691.    DWORD dwReserved;            // for future use
  1692.    }
  1693.    CTLINITBEDIT, FAR *LPCTLINITBEDIT;
  1694.  
  1695. typedef struct tagBOXEDITINFO   // 1.1 box edit Size Info
  1696.    {
  1697.    int cxBox;                   // width of a single box
  1698.    int cyBox;                   // ditto height
  1699.    int cxBase;                  // in-box x-margin to guideline
  1700.    int cyBase;                  // in-box y offset from top to baseline
  1701.    int cyMid;                   // 0 or distance from baseline to midline
  1702.    BOXLAYOUT boxlayout;         // embedded BOXLAYOUT structure
  1703.    UINT wFlags;                 // BEIF_xx
  1704.    BYTE szFaceName[BEI_FACESIZE];   // font face name
  1705.    UINT wFontHeight;            // font height
  1706.    UINT rgwReserved[8];         // for future use
  1707.    }
  1708.    BOXEDITINFO, FAR *LPBOXEDITINFO;
  1709. #endif /*!NOPENBEDIT */
  1710.  
  1711. //---------------------------------------------------------------------------
  1712. #ifndef NOPENCTL
  1713.  
  1714. typedef struct tagRECTOFS       // 1.0 rectangle offset for nonisometric inflation
  1715.    {
  1716.    int dLeft;                   // inflation leftwards from left side
  1717.    int dTop;                    // ditto upwards from top
  1718.    int dRight;                  // ditto rightwards from right
  1719.    int dBottom;                 // ditto downwards from bottom
  1720.    }
  1721.    RECTOFS, FAR *LPRECTOFS;
  1722. #endif /*!NOPENCTL */
  1723.  
  1724. //---------------------------------------------------------------------------
  1725. #ifndef NOPENDATA
  1726.  
  1727. typedef struct tagPENDATAHEADER // 1.0 main pen data header
  1728.    {
  1729.    UINT wVersion;               // pen data format version
  1730.    UINT cbSizeUsed;             // size of pendata mem block in bytes
  1731.    UINT cStrokes;               // number of strokes (incl up-strokes)
  1732.    UINT cPnt;                   // count of all points
  1733.    UINT cPntStrokeMax;          // length (in points) of longest stroke
  1734.    RECT rectBound;              // bounding rect of all down points
  1735.    UINT wPndts;                 // PDTS_xx bits
  1736.    int  nInkWidth;              // ink width in pixels
  1737.    DWORD rgbInk;                // ink color
  1738.    }
  1739.    PENDATAHEADER, FAR *LPPENDATAHEADER, FAR *LPPENDATA;
  1740.  
  1741. typedef struct tagSTROKEINFO    // 1.0 stroke header
  1742.    {
  1743.    UINT cPnt;                   // count of points in stroke
  1744.    UINT cbPnts;                 // size of stroke in bytes
  1745.    UINT wPdk;                   // state of stroke
  1746.    DWORD dwTick;                // time at beginning of stroke
  1747.    }
  1748.    STROKEINFO, FAR *LPSTROKEINFO;
  1749.  
  1750. typedef struct tagPENTIP        // 2.0 Pen Tip characteristics
  1751.     {
  1752.     DWORD cbSize;               // sizeof(PENTIP)
  1753.     BYTE btype;                 // pen type/nib (calligraphic nib, etc.)
  1754.     BYTE bwidth;                // width of Nib (typically == nInkWidth)
  1755.     BYTE bheight;               // height of Nib
  1756.     BYTE bOpacity;              // 0=transparent, 0x80=hilite, 0xFF=opaque
  1757.     COLORREF rgb;               // pen color
  1758.     DWORD dwFlags;              // TIP_xx flags
  1759.     DWORD dwReserved;           // for future expansion
  1760.     }
  1761.     PENTIP, FAR *LPPENTIP;
  1762.  
  1763. typedef BOOL (CALLBACK *ANIMATEPROC)(HPENDATA, UINT, UINT, UINT FAR*, LPARAM);
  1764.  
  1765. typedef struct tagANIMATEINFO   // 2.0 Animation parameters
  1766.     {
  1767.     DWORD cbSize;               // sizeof(ANIMATEINFO)
  1768.     UINT uSpeedPct;             // speed percent to animate at
  1769.     UINT uPeriodCB;             // time between calls to callback in ms
  1770.     UINT fuFlags;               // animation flags
  1771.     LPARAM lParam;              // value to pass to callback
  1772.     DWORD dwReserved;           // reserved
  1773.     }
  1774.     ANIMATEINFO, FAR *LPANIMATEINFO;
  1775. #endif /*!NOPENDATA */
  1776.  
  1777. //---------------------------------------------------------------------------
  1778. #ifndef NOPENDRIVER
  1779.  
  1780. typedef struct tagOEMPENINFO    // 1.0 OEM pen/tablet hdwe info
  1781.    {
  1782.    UINT wPdt;                   // pen data type
  1783.    UINT wValueMax;              // largest val ret by device
  1784.    UINT wDistinct;              // number of distinct readings possible
  1785.    }
  1786.    OEMPENINFO, FAR *LPOEMPENINFO;
  1787.  
  1788. typedef struct tagPENPACKET     // 1.0 pen packet
  1789.    {
  1790.    UINT wTabletX;               // x in raw coords
  1791.    UINT wTabletY;               // ditto y
  1792.    UINT wPDK;                   // state bits
  1793.    UINT rgwOemData[MAXOEMDATAWORDS]; // OEM-specific data
  1794.    }
  1795.    PENPACKET, FAR *LPPENPACKET;
  1796.  
  1797. typedef struct tagOEM_PENPACKET // 2.0
  1798.    {
  1799.    UINT wTabletX;               // x in raw coords
  1800.    UINT wTabletY;               // ditto y
  1801.    UINT wPDK;                   // state bits
  1802.    UINT rgwOemData[MAXOEMDATAWORDS];  // OEM-specific data
  1803.    DWORD dwTime;
  1804.    }
  1805.     OEM_PENPACKET, FAR *LPOEM_PENPACKET;
  1806.  
  1807. typedef struct tagPENINFO       // 1.0 pen/tablet hdwe info
  1808.    {
  1809.    UINT cxRawWidth;             // max x coord and tablet width in 0.001"
  1810.    UINT cyRawHeight;            // ditto y, height
  1811.    UINT wDistinctWidth;         // number of distinct x values tablet ret
  1812.    UINT wDistinctHeight;        // ditto y
  1813.    int nSamplingRate;           // samples / second
  1814.    int nSamplingDist;           // min distance to move before generating event
  1815.    LONG lPdc;                   // Pen Device Capabilities
  1816.    int cPens;                   // number of pens supported
  1817.    int cbOemData;               // width of OEM data packet
  1818.    OEMPENINFO rgoempeninfo[MAXOEMDATAWORDS]; // supported OEM data types
  1819.    UINT rgwReserved[7];         // for internal use
  1820.    UINT fuOEM;                  // which OEM data, timing, PDK_xx to report
  1821.    }
  1822.    PENINFO, FAR *LPPENINFO;
  1823.  
  1824. typedef struct tagCALBSTRUCT    // 1.0 pen calibration
  1825.    {
  1826.    int wOffsetX;
  1827.    int wOffsetY;
  1828.    int wDistinctWidth;
  1829.    int wDistinctHeight;
  1830.    }
  1831.    CALBSTRUCT, FAR *LPCALBSTRUCT;
  1832.  
  1833. typedef BOOL (CALLBACK *LPFNRAWHOOK)(LPPENPACKET);
  1834. #endif /*!NOPENDRIVER */
  1835.  
  1836. //---------------------------------------------------------------------------
  1837. #ifndef NOPENHRC
  1838.  
  1839. // Handwriting Recognizer:
  1840.  
  1841. DECLARE_HANDLE32(HRC);          // Handwriting Recognition Context
  1842. DECLARE_HANDLE32(HRCRESULT);    // HRC result
  1843. DECLARE_HANDLE32(HWL);          // Handwriting wordlist
  1844. DECLARE_HANDLE32(HRECHOOK);     // Recognition Result hook handle
  1845.  
  1846. typedef HRC                     FAR *LPHRC;
  1847. typedef HRCRESULT               FAR *LPHRCRESULT;
  1848. typedef HWL                     FAR *LPHWL;
  1849.  
  1850. typedef BOOL (CALLBACK *HRCRESULTHOOKPROC)
  1851.     (HREC, HRC, UINT, UINT, UINT, LPVOID);
  1852.  
  1853. // Inksets:
  1854. DECLARE_HANDLE(HINKSET);        // handle to an inkset
  1855. typedef HINKSET                 FAR* LPHINKSET; // ptr to HINKSET
  1856.  
  1857. typedef struct tagINTERVAL      // 2.0 interval structure for inksets
  1858.     {
  1859.     ABSTIME atBegin;            // begining of 1-ms granularity interval
  1860.     ABSTIME atEnd;              // 1 ms past end of interval
  1861.     }
  1862.     INTERVAL, FAR *LPINTERVAL;
  1863.  
  1864. typedef struct tagBOXRESULTS    // 2.0
  1865.     {
  1866.     UINT indxBox;
  1867.     HINKSET hinksetBox;
  1868.     SYV rgSyv[1];
  1869.     }
  1870.     BOXRESULTS, FAR *LPBOXRESULTS;
  1871.  
  1872. typedef struct tagGUIDE         // 1.0 guide structure
  1873.    {
  1874.    int xOrigin;                 // left edge of first box (screen coord))
  1875.    int yOrigin;                 // ditto top edge
  1876.    int cxBox;                   // width of a single box
  1877.    int cyBox;                   // ditto height
  1878.    int cxBase;                  // in-box x-margin to guideline
  1879.    int cyBase;                  // in-box y offset from top to baseline
  1880.    int cHorzBox;                // count of boxed columns
  1881.    int cVertBox;                // ditto rows
  1882.    int cyMid;                   // 0 or distance from baseline to midline
  1883.    }
  1884.    GUIDE, FAR *LPGUIDE;
  1885.  
  1886. #endif /*!NOPENHRC */
  1887.  
  1888. //---------------------------------------------------------------------------
  1889. #ifndef NOPENIEDIT
  1890.  
  1891. typedef struct tagCTLINITIEDIT  // 2.0 init struct for Ink Edit
  1892.     {
  1893.     DWORD cbSize;               // sizeof(CTLINITIEDIT)
  1894.     HWND hwnd;                  // IEdit window handle
  1895.     int id;                     // its ID
  1896.     WORD ieb;                   // IEB_* (background) bits
  1897.     WORD iedo;                  // IEDO_* (draw options) bits
  1898.     WORD iei;                   // IEI_* (ink input) bits
  1899.     WORD ien;                   // IEN_* (notification) bits
  1900.     WORD ierec;                 // IEREC_* (recognition) bits
  1901.     WORD ies;                   // IES_* (style) bits
  1902.     WORD iesec;                 // IESEC_* (security) bits
  1903.     WORD pdts;                  // initial pendata scale factor (PDTS_*)
  1904.     HPENDATA hpndt;             // initial pendata (or NULL if none)
  1905.     HGDIOBJ hgdiobj;            // background brush or bitmap handle
  1906.     HPEN hpenGrid;              // pen to use in drawing grid
  1907.     POINT ptOrgGrid;            // grid lines point of origin
  1908.     WORD wVGrid;                // vertical gridline spacing
  1909.     WORD wHGrid;                // horizontal gridline spacing
  1910.     DWORD dwApp;                // application-defined data
  1911.     DWORD dwReserved;           // reserved for future use
  1912.     }
  1913.     CTLINITIEDIT, FAR *LPCTLINITIEDIT;
  1914.  
  1915. typedef struct tagPDEVENT       // 2.0
  1916.     {
  1917.     DWORD cbSize;               // sizeof(PDEVENT)
  1918.     HWND hwnd;                  // window handle of I-Edit
  1919.     UINT wm;                    // WM_* (window message) of event
  1920.     WPARAM wParam;              // wParam of message
  1921.     LPARAM lParam;              // lParam of message
  1922.     POINT pt;                   // event pt in I-Edit client co-ords
  1923.     BOOL fPen;                  // TRUE if pen (or other inking device)
  1924.     LONG lExInfo;               // GetMessageExtraInfo() return value
  1925.     DWORD dwReserved;           // for future use
  1926.     }
  1927.     PDEVENT, FAR *LPPDEVENT;
  1928.  
  1929. typedef struct tagSTRKFMT       // 2.0
  1930.     {
  1931.     DWORD cbSize;               // sizeof(STRKFMT)
  1932.     UINT iesf;                  // stroke format flags and return bits
  1933.     UINT iStrk;                 // stroke index if IESF_STROKE
  1934.     PENTIP tip;                 // ink tip attributes
  1935.     DWORD dwUser;               // user data for strokes
  1936.     DWORD dwReserved;           // for future use
  1937.     }
  1938.     STRKFMT, FAR *LPSTRKFMT;
  1939. #endif /*!NOPENIEDIT */
  1940.  
  1941. //---------------------------------------------------------------------------
  1942. #ifndef NOPENINKPUT
  1943.  
  1944. typedef struct tagPCMINFO       // 2.0 Pen Collection Mode Information
  1945.    {
  1946.    DWORD cbSize;                // sizeof(PCMINFO)
  1947.    DWORD dwPcm;                 // PCM_xxx flags
  1948.    RECT rectBound;              // if finish on pendown outside this rect
  1949.    RECT rectExclude;            // if finish on pendown inside this rect
  1950.    HRGN hrgnBound;              // if finish on pendown outside this region
  1951.    HRGN hrgnExclude;            // if finish on pendown inside this region
  1952.    DWORD dwTimeout;             // if finish after timeout, this many ms
  1953.    }
  1954.     PCMINFO, FAR *LPPCMINFO;
  1955.  
  1956. typedef struct tagINKINGINFO    // 2.0 Pen Inking Information
  1957.    {
  1958.    DWORD cbSize;                // sizeof(INKINGINFO)
  1959.    UINT wFlags;                 // One of the PII_xx flags
  1960.    PENTIP tip;                  // Pen type, size and color
  1961.    RECT rectClip;               // Clipping rect for the ink
  1962.    RECT rectInkStop;            // Rect in which a pen down stops inking
  1963.    HRGN hrgnClip;               // Clipping region for the ink
  1964.    HRGN hrgnInkStop;            // Region in which a pen down stops inking
  1965.    }
  1966.     INKINGINFO, FAR *LPINKINGINFO;
  1967. #endif /*!NOPENINKPUT */
  1968.  
  1969. //---------------------------------------------------------------------------
  1970. #ifndef NOPENRC1    // not available in WIN32
  1971.  
  1972. typedef struct tagSYC           // 1.0 Symbol Correspondence for Ink
  1973.    {
  1974.    UINT wStrokeFirst;           // first stroke, inclusive
  1975.    UINT wPntFirst;              // first point in first stroke, inclusive
  1976.    UINT wStrokeLast;            // last stroke, inclusive
  1977.    UINT wPntLast;               // last point in last stroke, inclusive
  1978.    BOOL fLastSyc;               // T: no more SYCs follow for current SYE
  1979.    }
  1980.    SYC, FAR *LPSYC;
  1981.  
  1982. typedef struct tagSYE           // 1.0 Symbol Element
  1983.    {
  1984.    SYV syv;                     // symbol value
  1985.    LONG lRecogVal;              // for internal use by recognizer
  1986.    CL cl;                       // confidence level
  1987.    int iSyc;                    // SYC index
  1988.    }
  1989.    SYE, FAR *LPSYE;
  1990.  
  1991. typedef struct tagSYG           // 1.0 Symbol Graph
  1992.    {
  1993.    POINT rgpntHotSpots[MAXHOTSPOT]; // hot spots (max 8)
  1994.    int cHotSpot;                // number of valid hot spots in rgpntHotSpots
  1995.    int nFirstBox;               // row-major index to box of 1st char in result
  1996.    LONG lRecogVal;              // reserved for use by recoognizer
  1997.    LPSYE lpsye;                 // nodes of symbol graph
  1998.    int cSye;                    // number of SYEs in symbol graph
  1999.    LPSYC lpsyc;                 // ptr to corresp symbol ink
  2000.    int cSyc;                    // ditto count
  2001.    }
  2002.    SYG, FAR *LPSYG;
  2003.  
  2004. typedef struct tagRC            // 1.0 Recognition Context (RC)
  2005.    {
  2006.    HREC hrec;                   // handle of recognizer to use
  2007.    HWND hwnd;                   // window to send results to
  2008.    UINT wEventRef;              // index into ink buffer
  2009.    UINT wRcPreferences;         // flags: RCP_xx Preferences
  2010.    LONG lRcOptions;             // RCO_xx options
  2011.    RCYIELDPROC lpfnYield;       // procedure called during Yield()
  2012.    BYTE lpUser[cbRcUserMax];    // current writer
  2013.    UINT wCountry;               // country code
  2014.    UINT wIntlPreferences;       // flags: RCIP_xx
  2015.    char lpLanguage[cbRcLanguageMax]; // language strings
  2016.    LPDF rglpdf[MAXDICTIONARIES];   // list of dictionary functions
  2017.    UINT wTryDictionary;         // max enumerations to search
  2018.    CL clErrorLevel;             // level where recognizer should reject input
  2019.    ALC alc;                     // enabled alphabet
  2020.    ALC alcPriority;             // prioritizes the ALC_ codes
  2021.    BYTE rgbfAlc[cbRcrgbfAlcMax];   // bit field for enabled characters
  2022.    UINT wResultMode;            // RRM_xx when to send (asap or when complete)
  2023.    UINT wTimeOut;               // recognition timeout in ms
  2024.    LONG lPcm;                   // flags: PCM_xx for ending recognition
  2025.    RECT rectBound;              // bounding rect for inking (def:screen coords)
  2026.    RECT rectExclude;            // pen down inside this terminates recognition
  2027.    GUIDE guide;                 // struct: defines guidelines for recognizer
  2028.    UINT wRcOrient;              // RCOR_xx orientation of writing wrt tablet
  2029.    UINT wRcDirect;              // RCD_xx direction of writing
  2030.    int nInkWidth;               // ink width 0 (none) or 1..15 pixels
  2031.    COLORREF rgbInk;             // ink color
  2032.    DWORD dwAppParam;            // for application use
  2033.    DWORD dwDictParam;           // for app use to be passed on to dictionaries
  2034.    DWORD dwRecognizer;          // for app use to be passed on to recognizer
  2035.    UINT rgwReserved[cwRcReservedMax]; // reserved for future use by Windows
  2036.    }
  2037.    RC, FAR *LPRC;
  2038.  
  2039. typedef struct tagRCRESULT      // 1.0 Recognition Result
  2040.    {
  2041.    SYG syg;                     // symbol graph
  2042.    UINT wResultsType;           // see RCRT_xx
  2043.    int cSyv;                    // count of symbol values
  2044.    LPSYV lpsyv;                 // NULL-term ptr to recog's best guess
  2045.    HANDLE hSyv;                 // globally-shared handle to lpsyv mem
  2046.    int nBaseLine;               // 0 or baseline of input writing
  2047.    int nMidLine;                // ditto midline
  2048.    HPENDATA hpendata;           // pen data mem
  2049.    RECT rectBoundInk;           // ink data bounds
  2050.    POINT pntEnd;                // pt that terminated recog
  2051.    LPRC lprc;                   // recog context used
  2052.    }
  2053.    RCRESULT, FAR *LPRCRESULT;
  2054.  
  2055. typedef int         (CALLBACK *LPFUNCRESULTS)(LPRCRESULT, REC);
  2056.  
  2057. #endif /*!NOPENRC1 */
  2058.  
  2059. //---------------------------------------------------------------------------
  2060. #ifndef NOPENTARGET
  2061.  
  2062. #ifndef _WIN32
  2063. #if (WINVER < 0x0400)
  2064. #ifndef _OLE2_H_
  2065. typedef struct tagRECTL
  2066. {                      
  2067.    LONG     left;      
  2068.    LONG     top;       
  2069.    LONG     right;     
  2070.    LONG     bottom;    
  2071. } RECTL;               
  2072. typedef RECTL*       PRECTL; 
  2073. typedef RECTL NEAR*  NPRECTL; 
  2074. typedef RECTL FAR*   LPRECTL;  
  2075. typedef const RECTL FAR* LPCRECTL;
  2076. #endif // !_OLE2_H_
  2077. #endif // WINVER
  2078. #endif // !WIN32
  2079.  
  2080. typedef struct tagTARGET        // 2.0 Geometry for a single target.
  2081.    {
  2082.    DWORD dwFlags;               // individual target flags
  2083.    DWORD idTarget;              // TARGINFO.rgTarget[] index
  2084.    HTRG  htrgTarget;            // HANDLE32 equiv
  2085.    RECTL rectBound;             // Bounding rect of the target
  2086.    DWORD dwData;                // data collection info per target
  2087.    RECTL rectBoundInk;          // Reserved for internal use, must be zero
  2088.    RECTL rectBoundLastInk;      // Reserved for internal use, must be zero
  2089.    }
  2090.    TARGET, FAR *LPTARGET;
  2091.  
  2092. typedef struct tagTARGINFO      // 2.0 A set of targets
  2093.    {
  2094.    DWORD cbSize;                // sizeof(TARGINFO)
  2095.    DWORD dwFlags;               // flags
  2096.    HTRG htrgOwner;              // HANDLE32 equiv
  2097.    WORD cTargets;               // count of targets
  2098.    WORD iTargetLast;            // last target, used by TargetPoints API
  2099.                                 // if TPT_TEXTUAL flag is set
  2100.    TARGET rgTarget[1];          // variable-length array of targets
  2101.    }
  2102.    TARGINFO, FAR *LPTARGINFO;
  2103.  
  2104. typedef struct tagINPPARAMS     // 2.0
  2105.    {
  2106.    DWORD cbSize;                // sizeof(INPPARAMS)
  2107.    DWORD dwFlags;
  2108.    HPENDATA hpndt;
  2109.    TARGET target;               // target structure
  2110.    }
  2111.     INPPARAMS, FAR *LPINPPARAMS;
  2112. #endif /*!NOPENTARGET */
  2113.  
  2114. //////////////////////////////////////////////////////////////////////////////
  2115. /****** APIs and Prototypes *************************************************/
  2116.  
  2117. LRESULT CALLBACK    DefPenWindowProc(HWND, UINT, WPARAM, LPARAM);
  2118.  
  2119. //---------------------------------------------------------------------------
  2120. #ifndef NOPENAPPS   // not available in WIN32
  2121.  
  2122. // Pen System Applications:
  2123. BOOL      WINAPI ShowKeyboard(HWND, UINT, LPPOINT, LPSKBINFO);
  2124.  
  2125. #endif /*!NOPENAPPS */
  2126.  
  2127. //---------------------------------------------------------------------------
  2128. #ifndef NOPENDATA   // these APIs are implemented in PKPD.DLL
  2129.  
  2130. // PenData:
  2131. #ifndef NOPENAPIFUN
  2132. LPPENDATA WINAPI BeginEnumStrokes(HPENDATA);
  2133. LPPENDATA WINAPI EndEnumStrokes(HPENDATA);
  2134. HPENDATA  WINAPI CompactPenData(HPENDATA, UINT);
  2135. HPENDATA  WINAPI CreatePenData(LPPENINFO, int, UINT, UINT);
  2136. VOID      WINAPI DrawPenData(HDC, LPRECT, HPENDATA);
  2137. BOOL      WINAPI GetPenDataStroke(LPPENDATA, UINT, LPPOINT FAR*,
  2138.                                   LPVOID FAR*, LPSTROKEINFO);
  2139. #endif //!NOPENAPIFUN
  2140. HPENDATA  WINAPI AddPointsPenData(HPENDATA, LPPOINT, LPVOID, LPSTROKEINFO);
  2141. int       WINAPI CompressPenData(HPENDATA, UINT, DWORD);
  2142. HPENDATA  WINAPI CreatePenDataEx(LPPENINFO, UINT, UINT, UINT);
  2143. HRGN      WINAPI CreatePenDataRegion(HPENDATA, UINT);
  2144. BOOL      WINAPI DestroyPenData(HPENDATA);
  2145. int       WINAPI DrawPenDataEx(HDC, LPRECT, HPENDATA, UINT, UINT, UINT, UINT,
  2146.                                ANIMATEPROC, LPANIMATEINFO, UINT);
  2147. HPENDATA  WINAPI DuplicatePenData(HPENDATA, UINT);
  2148. int       WINAPI ExtractPenDataPoints(HPENDATA, UINT, UINT, UINT, LPPOINT,
  2149.                                       LPVOID, UINT);
  2150. int       WINAPI ExtractPenDataStrokes(HPENDATA, UINT, LPARAM,
  2151.                                        LPHPENDATA, UINT);
  2152. int       WINAPI GetPenDataAttributes(HPENDATA, LPVOID, UINT);
  2153. BOOL      WINAPI GetPenDataInfo(HPENDATA, LPPENDATAHEADER, LPPENINFO, DWORD);
  2154. BOOL      WINAPI GetPointsFromPenData(HPENDATA, UINT, UINT, UINT, LPPOINT);
  2155. int       WINAPI GetStrokeAttributes(HPENDATA, UINT, LPVOID, UINT);
  2156. int       WINAPI GetStrokeTableAttributes(HPENDATA, UINT, LPVOID, UINT);
  2157. int       WINAPI HitTestPenData(HPENDATA, LPPOINT, UINT, UINT FAR*, UINT FAR*);
  2158. int       WINAPI InsertPenData(HPENDATA, HPENDATA, UINT);
  2159. int       WINAPI InsertPenDataPoints(HPENDATA, UINT, UINT, UINT,
  2160.                                      LPPOINT, LPVOID);
  2161. int       WINAPI InsertPenDataStroke(HPENDATA, UINT, LPPOINT, LPVOID,
  2162.                                      LPSTROKEINFO);
  2163. BOOL      WINAPI MetricScalePenData(HPENDATA, UINT);
  2164. BOOL      WINAPI OffsetPenData(HPENDATA, int, int);
  2165. LONG      WINAPI PenDataFromBuffer(LPHPENDATA, UINT, LPBYTE, LONG, LPDWORD);
  2166. LONG      WINAPI PenDataToBuffer(HPENDATA, LPBYTE, LONG, LPDWORD);
  2167. BOOL      WINAPI RedisplayPenData(HDC, HPENDATA, LPPOINT, LPPOINT,
  2168.                                   int, DWORD);
  2169. int       WINAPI RemovePenDataStrokes(HPENDATA, UINT, UINT);
  2170. BOOL      WINAPI ResizePenData(HPENDATA, LPRECT);
  2171. int       WINAPI SetStrokeAttributes(HPENDATA, UINT, LPARAM, UINT);
  2172. int       WINAPI SetStrokeTableAttributes(HPENDATA, UINT, LPARAM, UINT);
  2173. int       WINAPI TrimPenData(HPENDATA, DWORD, DWORD);
  2174.  
  2175. #endif /*!NOPENDATA */
  2176.  
  2177. //---------------------------------------------------------------------------
  2178. #ifndef NOPENDICT   // not available in WIN32
  2179.  
  2180. // Dictionary:
  2181. BOOL      WINAPI DictionarySearch(LPRC, LPSYE, int, LPSYV, int);
  2182. #endif /*!NOPENDICT */
  2183.  
  2184. //---------------------------------------------------------------------------
  2185. #ifndef NOPENDRIVER
  2186.  
  2187. // Pen Hardware/Driver:
  2188. #ifndef NOPENAPIFUN
  2189. BOOL      WINAPI EndPenCollection(REC);
  2190. REC       WINAPI GetPenHwData(LPPOINT, LPVOID, int, UINT, LPSTROKEINFO);
  2191. REC       WINAPI GetPenHwEventData(UINT, UINT, LPPOINT, LPVOID,
  2192.                                    int, LPSTROKEINFO);
  2193. BOOL      WINAPI SetPenHook(HKP, LPFNRAWHOOK);
  2194. VOID      WINAPI UpdatePenInfo(LPPENINFO);
  2195. #endif //!NOPENAPIFUN
  2196. BOOL      WINAPI GetPenAsyncState(UINT);
  2197. BOOL      WINAPI IsPenEvent(UINT, LONG);
  2198. #endif /*!NOPENDRIVER */
  2199.  
  2200. //---------------------------------------------------------------------------
  2201. #ifndef NOPENHRC
  2202.  
  2203. // Handwriting Recognizer:
  2204. int       WINAPI AddPenDataHRC(HRC, HPENDATA);
  2205. int       WINAPI AddPenInputHRC(HRC, LPPOINT, LPVOID, UINT, LPSTROKEINFO);
  2206. int       WINAPI AddWordsHWL(HWL, LPSTR, UINT);
  2207. int       WINAPI ConfigHREC(HREC, UINT, WPARAM, LPARAM);
  2208. HRC       WINAPI CreateCompatibleHRC(HRC, HREC);
  2209. HWL       WINAPI CreateHWL(HREC, LPSTR, UINT, DWORD);
  2210. HINKSET   WINAPI CreateInksetHRCRESULT(HRCRESULT, UINT, UINT);
  2211. HPENDATA  WINAPI CreatePenDataHRC(HRC);
  2212. int       WINAPI DestroyHRC(HRC);
  2213. int       WINAPI DestroyHRCRESULT(HRCRESULT);
  2214. int       WINAPI DestroyHWL(HWL);
  2215. int       WINAPI EnableGestureSetHRC(HRC, SYV, BOOL);
  2216. int       WINAPI EnableSystemDictionaryHRC(HRC, BOOL);
  2217. int       WINAPI EndPenInputHRC(HRC);
  2218. int       WINAPI GetAlphabetHRC(HRC, LPALC, LPBYTE);
  2219. int       WINAPI GetAlphabetPriorityHRC(HRC, LPALC, LPBYTE);
  2220. int       WINAPI GetAlternateWordsHRCRESULT(HRCRESULT, UINT, UINT,
  2221.                                             LPHRCRESULT, UINT);
  2222. int       WINAPI GetBoxMappingHRCRESULT(HRCRESULT, UINT, UINT, UINT FAR*);
  2223. int       WINAPI GetBoxResultsHRC(HRC, UINT, UINT, UINT, LPBOXRESULTS, BOOL);
  2224. int       WINAPI GetGuideHRC(HRC, LPGUIDE, UINT FAR*);
  2225. int       WINAPI GetHotspotsHRCRESULT(HRCRESULT, UINT, LPPOINT, UINT);
  2226. HREC      WINAPI GetHRECFromHRC(HRC);
  2227. int       WINAPI GetInternationalHRC(HRC, UINT FAR*, LPSTR, UINT FAR*,
  2228.                                      UINT FAR*);
  2229. int       WINAPI GetMaxResultsHRC(HRC);
  2230. int       WINAPI GetResultsHRC(HRC, UINT, LPHRCRESULT, UINT);
  2231. int       WINAPI GetSymbolCountHRCRESULT(HRCRESULT);
  2232. int       WINAPI GetSymbolsHRCRESULT(HRCRESULT, UINT, LPSYV, UINT);
  2233. int       WINAPI GetWordlistHRC(HRC, LPHWL);
  2234. int       WINAPI GetWordlistCoercionHRC(HRC);
  2235. int       WINAPI ProcessHRC(HRC, DWORD);
  2236. int       WINAPI ReadHWL(HWL, HFILE);
  2237. int       WINAPI SetAlphabetHRC(HRC, ALC, LPBYTE);
  2238. int       WINAPI SetAlphabetPriorityHRC(HRC, ALC, LPBYTE);
  2239. int       WINAPI SetBoxAlphabetHRC(HRC, LPALC, UINT);
  2240. int       WINAPI SetGuideHRC(HRC, LPGUIDE, UINT);
  2241. int       WINAPI SetInternationalHRC(HRC, UINT, LPCSTR, UINT, UINT);
  2242. int       WINAPI SetMaxResultsHRC(HRC, UINT);
  2243. HRECHOOK  WINAPI SetResultsHookHREC(HREC, HRCRESULTHOOKPROC);
  2244. int       WINAPI SetWordlistCoercionHRC(HRC, UINT);
  2245. int       WINAPI SetWordlistHRC(HRC, HWL);
  2246. int       WINAPI TrainHREC(HREC, LPSYV, UINT, HPENDATA, UINT);
  2247. int       WINAPI UnhookResultsHookHREC(HREC, HRECHOOK);
  2248. int       WINAPI WriteHWL(HWL, HFILE);
  2249.  
  2250. // Recognizer Installation:
  2251. HREC      WINAPI InstallRecognizer(LPSTR);
  2252. VOID      WINAPI UninstallRecognizer(HREC);
  2253.  
  2254. // Inksets:
  2255. BOOL      WINAPI AddInksetInterval(HINKSET, LPINTERVAL);
  2256. HINKSET   WINAPI CreateInkset(UINT);
  2257. BOOL      WINAPI DestroyInkset(HINKSET);
  2258. int       WINAPI GetInksetInterval(HINKSET, UINT, LPINTERVAL);
  2259. int       WINAPI GetInksetIntervalCount(HINKSET);
  2260.  
  2261. // Symbol Values:
  2262. int       WINAPI CharacterToSymbol(LPSTR, int, LPSYV);
  2263. BOOL      WINAPI SymbolToCharacter(LPSYV, int, LPSTR, LPINT);
  2264. #endif /*!NOPENHRC */
  2265.  
  2266. //---------------------------------------------------------------------------
  2267. #ifndef NOPENINKPUT
  2268.  
  2269. // Pen Input/Inking:
  2270. int       WINAPI DoDefaultPenInput(HWND, UINT);
  2271. int       WINAPI GetPenInput(HPCM, LPPOINT, LPVOID, UINT, UINT, LPSTROKEINFO);
  2272. int       WINAPI PeekPenInput(HPCM, UINT, LPPOINT, LPVOID, UINT);
  2273. int       WINAPI StartInking(HPCM, UINT, LPINKINGINFO);
  2274. HPCM      WINAPI StartPenInput(HWND, UINT, LPPCMINFO, LPINT);
  2275. int       WINAPI StopInking(HPCM);
  2276. int       WINAPI StopPenInput(HPCM, UINT, int);
  2277. #endif /*!NOPENINKPUT */
  2278.  
  2279. //---------------------------------------------------------------------------
  2280. #ifndef NOPENMISC
  2281.  
  2282. // Miscellaneous/Utilities:
  2283. VOID      WINAPI BoundingRectFromPoints(LPPOINT, UINT, LPRECT);
  2284. BOOL      WINAPI DPtoTP(LPPOINT, int);
  2285. UINT      WINAPI GetPenAppFlags(VOID);
  2286. VOID      WINAPI SetPenAppFlags(UINT, UINT);
  2287. LONG      WINAPI GetPenMiscInfo(WPARAM, LPARAM);
  2288. UINT      WINAPI GetVersionPenWin(VOID);
  2289. LONG      WINAPI SetPenMiscInfo(WPARAM, LPARAM);
  2290. BOOL      WINAPI TPtoDP(LPPOINT, int);
  2291. BOOL      WINAPI CorrectWriting(HWND, LPSTR, UINT, LPVOID, DWORD, DWORD);
  2292. #ifndef _WIN32
  2293. UINT      WINAPI IsPenAware(VOID);
  2294. VOID      WINAPI RegisterPenApp(UINT, UINT);
  2295. #endif //!_WIN32
  2296.  
  2297. #endif /*!NOPENMISC */
  2298.  
  2299. //---------------------------------------------------------------------------
  2300. #ifndef NOPENRC1    // not available in WIN32
  2301.  
  2302. // RC1:
  2303. VOID      WINAPI EmulatePen(BOOL);
  2304. UINT      WINAPI EnumSymbols(LPSYG, UINT, ENUMPROC, LPVOID);
  2305. BOOL      WINAPI ExecuteGesture(HWND, SYV, LPRCRESULT);
  2306. VOID      WINAPI FirstSymbolFromGraph(LPSYG, LPSYV, int, LPINT);
  2307. UINT      WINAPI GetGlobalRC(LPRC, LPSTR, LPSTR, int);
  2308. int       WINAPI GetSymbolCount(LPSYG);
  2309. int       WINAPI GetSymbolMaxLength(LPSYG);
  2310. VOID      WINAPI InitRC(HWND, LPRC);
  2311. REC       WINAPI ProcessWriting(HWND, LPRC);
  2312. REC       WINAPI Recognize(LPRC);
  2313. REC       WINAPI RecognizeData(LPRC, HPENDATA);
  2314. UINT      WINAPI SetGlobalRC(LPRC, LPSTR, LPSTR);
  2315. BOOL      WINAPI SetRecogHook(UINT, UINT, HWND);
  2316. BOOL      WINAPI TrainContext(LPRCRESULT, LPSYE, int, LPSYC, int);
  2317. BOOL      WINAPI TrainInk(LPRC, HPENDATA, LPSYV);
  2318.  
  2319. // Custom Recognizer functions - not PenWin APIs (formerly in penwoem.h):
  2320. VOID      WINAPI CloseRecognizer(VOID);
  2321. UINT      WINAPI ConfigRecognizer(UINT, WPARAM, LPARAM);
  2322. BOOL      WINAPI InitRecognizer(LPRC);
  2323. REC       WINAPI RecognizeDataInternal(LPRC, HPENDATA, LPFUNCRESULTS);
  2324. REC       WINAPI RecognizeInternal(LPRC, LPFUNCRESULTS);
  2325. BOOL      WINAPI TrainContextInternal(LPRCRESULT, LPSYE, int, LPSYC, int);
  2326. BOOL      WINAPI TrainInkInternal(LPRC, HPENDATA, LPSYV);
  2327. #endif /*!NOPENRC1 */
  2328.  
  2329. //---------------------------------------------------------------------------
  2330. #ifndef NOPENTARGET
  2331.  
  2332. // Ink Targeting:
  2333. int       WINAPI TargetPoints(LPTARGINFO, LPPOINT, DWORD, UINT, LPSTROKEINFO);
  2334.  
  2335. #endif /*!NOPENTARGET */
  2336.  
  2337. //---------------------------------------------------------------------------
  2338. #ifndef NOPENVIRTEVENT
  2339.  
  2340. // Virtual Event Layer:
  2341. VOID      WINAPI AtomicVirtualEvent(BOOL);
  2342. VOID      WINAPI PostVirtualKeyEvent(UINT, BOOL);
  2343. VOID      WINAPI PostVirtualMouseEvent(UINT, int, int);
  2344. #endif /*!NOPENVIRTEVENT */
  2345.  
  2346. //---------------------------------------------------------------------------
  2347.  
  2348. #ifdef  JAPAN
  2349. // Kanji
  2350. BOOL      WINAPI KKConvert(HWND hwndConvert, HWND hwndCaller,
  2351.                            LPSTR lpBuf, UINT cbBuf, LPPOINT lpPnt);
  2352.  
  2353. #endif //  JAPAN
  2354.  
  2355. #endif /* RC_INVOKED */ // ... all the way back from definitions:3
  2356.  
  2357. /****** End of Header Info *************************************************/
  2358.  
  2359. #ifdef __cplusplus
  2360. }
  2361. #endif /* __cplusplus */
  2362.  
  2363. #ifndef _WIN32
  2364. #ifndef RC_INVOKED
  2365. #pragma pack()
  2366. #endif /* RC_INVOKED */
  2367. #endif //!_WIN32
  2368.  
  2369. #ifdef __BORLANDC__
  2370. #  include <poppack.h>
  2371. #endif
  2372.  
  2373. #pragma option pop
  2374. #endif /* #define _INC_PENWIN */
  2375.